This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def all_perms(elements): | |
if len(elements) <=1: | |
yield elements | |
else: | |
for perm in all_perms(elements[1:]): | |
for i in range(len(elements)): | |
#nb elements[0:1] works in both string and list contexts | |
yield perm[:i] + elements[0:1] + perm[i:] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def determinePossiblities(i): | |
result = 1 | |
for ii in range(i): | |
if(ii) == 0: | |
pass | |
elif(ii) == 1: | |
result = 1 | |
else: | |
result = result * ii | |
if i > 0: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import math | |
import operator | |
number_of_quarters_in_a_year = 4; | |
number_of_quarters = 9 * number_of_quarters_in_a_year; | |
countries = [ | |
{ "name" : "Belgium", "starting_growth" : 58433.0, "end_growth" : 85113.0}, | |
{ "name" : "Germany", "starting_growth" : 493890.0, "end_growth" : 614660.0}, | |
{ "name" : "Ireland", "starting_growth" : 21348.8 ,"end_growth" : 48091.5}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import math | |
import random | |
def calc(num): | |
resultFound = False | |
for i in range(1,100): | |
ii = math.pow(2, i) | |
s = math.sqrt(num) | |
r = int(round(s / ii) * ii) | |
if r > 0: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Video = function(id, index){ | |
this.id = id; | |
this.index = index; | |
this.w = Math.random() * 200 + 100; | |
this.h = this.w * (9/16); | |
this.init(); | |
this.volume = 50; | |
this.muted = false; | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
params=" -uroot -p" | |
echo ' - - - - - - - ' | |
echo 'DB Name : '$1 | |
echo 'Password: '$2 | |
# Create Database | |
echo ' - - - - - - - ' | |
echo 'CREATE DATABASE IF NOT EXISTS $1;' | |
# Grant Options (Creates User Automatically) | |
echo ' - - - - - - - ' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
params=" -uroot -p" | |
echo ' - - - - - - - ' | |
echo 'DB Name : '$1 | |
echo 'Password: '$2 | |
# Create Database | |
echo ' - - - - - - - ' | |
echo 'CREATE DATABASE IF NOT EXISTS $1;' | |
# Grant Options (Creates User Automatically) | |
echo ' - - - - - - - ' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var SoftFloat = (function(){ | |
console.log('Hello World'); | |
function SoftFloat() { | |
this.value = this.source = this.target = 0; | |
this.targeting = false; | |
this.enabled = true; | |
this.ATTRACTION = 0.0000000001; | |
this.DAMPING = 0.000005; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
REPO_NAME=$1 | |
echo "NEW REPO NAME: $REPO_NAME" | |
echo -n "Are you sure you want to create github repo with name '$REPO_NAME' ? (y/n) > " | |
if read -t 5 response; then | |
if [ 'y' = "$response" ]; then | |
echo "Ok. Let's continue creating Repo" | |
echo "Creating Repository: $REPO_NAME" | |
curl -u 'thejsj' https://api.github.com/user/repos -d "{\"name\":\"$REPO_NAME\"}" | |
# Remember replace USER with your username and REPO with your repository/application name! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Creating Wordpress Instalation | |
THIS_YEAR=$(date +%Y) | |
if [[ -z "$1" ]]; then | |
PROJECT_NAME=$1 | |
fi; | |
if [[ -z "$PROJECT_NAME" ]]; then | |
read -p "Wordpress Project Name : " PROJECT_NAME |
OlderNewer