This file contains hidden or 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
| #!/usr/bin/python | |
| # -*- coding: iso-8859-15 -*- | |
| """ | |
| Script to find image references | |
| Authors | |
| ------------------------------- | |
| - Ethan J. Eldridge [01/2014] | |
| Looks through images directory to find list of files |
This file contains hidden or 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
| #------------------------------------------------------------------------------- | |
| # Name: get_image_size | |
| # Purpose: extract image dimensions given a file path using just | |
| # core modules | |
| # | |
| # Author: Paulo Scardine (based on code from Emmanuel VAÏSSE), Ethan Eldridge (ICO) | |
| # | |
| # Created: 26/09/2013 | |
| # Copyright: (c) Paulo Scardine 2013 | |
| # Licence: MIT |
This file contains hidden or 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
| <script type="text/javascript"> | |
| /* Javascript to force incremental changes | |
| * If checkbox 1,2, 5 are checked then all | |
| * migrations 1,2,3,4,5 should be applied. | |
| * If checkbox 3 is unchecked, all checkboxes | |
| * after 3 should be unchecked as well. | |
| */ | |
| var inputs = document.getElementsByName("migrations[]"); | |
| for (var i = inputs.length - 1; i >= 0; i--) { | |
| inputs[i].onclick = function(evt){ |
This file contains hidden or 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
| #include <sys/wait.h> | |
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <unistd.h> | |
| #include <string.h> | |
| #define GENERATIONS 4 | |
| #define POPULATION_SIZE 80 | |
| int main(){ |
This file contains hidden or 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
| function interpolate(str){ | |
| /* Interpolate on {[0-9]+} */ | |
| if (arguments.length < 2) | |
| return str; | |
| /* Break string by it's interpolation parts */ | |
| var split = str.split(/\{([0-9]+)\}/gm); | |
| var numex = /^\d+$/ | |
| for (var i = split.length - 1; i >= 0; i--) { | |
| if(numex.test(split[i])){ |
This file contains hidden or 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
| #include <stdio.h> | |
| #include <time.h> | |
| #include <stdlib.h> | |
| #include <string.h> | |
| #include <math.h> /* link with -lm */ | |
| #define NETWORK_WIDTH 5 | |
| #define NETWORK_HEIGHT 4 | |
| #define NUMBER_NETWORKS 80 |
This file contains hidden or 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
| """ | |
| Author: Ethan Joachim Eldridge | |
| Website: ejehardenberg.github.io | |
| Contact me through my github. | |
| This code is available for use in the public domain to help out with | |
| people migrating from WP to Harp, http://harpjs.com/ | |
| I do appreciate a star on the gist if it helped you though. | |
| """ |
This file contains hidden or 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
| /* | |
| Needs strmap http://pokristensson.com/strmap.html | |
| */ | |
| /* | |
| * Parse the url and store values into the hash table | |
| * returns the number of values successfully placed into the hashtable | |
| */ | |
| int parseURL(char * url, int urlLength, StrMap * table){ | |
| int i; | |
| int j; |
This file contains hidden or 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
| 1 tails = 0 | |
| 2 heads = 0 | |
| 3 success = 0 | |
| 4 numTrials = 10000000 | |
| 5 | |
| 6 import random | |
| 7 | |
| 8 | |
| 9 for t in range(numTrials): | |
| 10 for i in range(256): |
This file contains hidden or 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
| MYSQL_HOST="localhost" | |
| MYSQL_USER="username" | |
| MYSQL_PASS="password" | |
| MYSQL_DB ="databasename" | |
| #Query for getting column names from database | |
| TABLE_INFO = "SELECT distinct column_name FROM information_schema.columns WHERE table_name = '%s' order by ordinal_position asc" | |
| class ORM_Base(): | |
| def __init__(self,pk_id=None): |