Elegant supports liquid_tags.include_code plugin.

Example 1

Calculate square root of 8square-root.pydownload
# -*- coding: utf-8 -*-
# Python Program to calculate the square root
# Note: change this value for a different result
num = 8
# To take the input from the user
# num = float(input('Enter a number: '))
num_sqrt = num ** 0.5
print("The square root of %0.3f is %0.3f" % (num, num_sqrt))

Example 2 — Without Filename

Fish Shell alias for seddownload
function sed -d 'alias sed to gsed'
    command gsed $argv;
end
Fish Shell alias for sedalias-sed.fish
function sed -d 'alias sed to gsed'
    command gsed $argv;
end
Fish Shell alias for sed
function sed -d 'alias sed to gsed'
    command gsed $argv;
end

Example 5 — Without Metadata

// From https://gist.github.com/joelpt/3824024
//
// The Babylonian Method
// http://en.wikipedia.org/wiki/Methods_of_computing_square_roots#Babylonian_method
// @param n - the number to compute the square root of
// @param g - the best guess so far (can omit from initial call)
function squirt(n, g) {
  if (!g) {
    // Take an initial guess at the square root
    g = n / 2.0;
  }
  var d = n / g; // Divide our guess into the number
  var ng = (d + g) / 2.0; // Use average of g and d as our new guess
  if (g == ng) {
    // The new guess is the same as the old guess; further guesses
    // can get no more accurate so we return this guess
    return g;
  }
  // Recursively solve for closer and closer approximations of the square root
  return squirt(n, ng);
}

console.log(squirt(42)); // 6.48074069840786

Like this post? Share on: TwitterFacebookEmail


Talha Mansoor Avatar Talha Mansoor is the creator and lead developer of Elegant theme.

Keep Reading


Published

Last Updated

Category

Supported Plugins

Tags

Stay in Touch

Get New Release Alert