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
<? | |
// array to store sequence - initialised with first 2 numbers | |
$nums = array(0,1); | |
// loop 20 times creating more numbers in the sequence | |
for($i = 1; $i <=20; $i++) { | |
$next = $nums[$i]+$nums[$i-1]; | |
array_push($nums,$next); | |
} |
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 | |
# | |
#AUTHOR: Pete Williamson | |
#DATE: 2014-10-21 | |
# | |
#USAGE: | |
# Creates smaller versions of supplied CSV file, | |
# based on the line number values as the second parameter | |
# | |
# The resulting CSVs are zipped up (for windows compatibility) |
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
<cfscript> | |
lst = ''; | |
cnt = 10000; | |
for( i = 1; i <= cnt; i++ ) { | |
val = randRange( 1, 5 ); | |
lst = listAppend( lst, val ); | |
} |
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 | |
# | |
# Supply 2 params from cmd, path to search and the term. | |
# The script will cd to $path, then check any directories | |
# it finds for the presence of a .git directory. | |
# | |
# If it finds a .git directory, a repo is assumed and | |
# a case insensitive grep is performed on term | |
# | |
# example: |
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
ls -la | awk '{print $9}' | grep -v comcar | egrep '^[a-z]' | while read -r line; do sed -e "s/myrepo/$line/" myrepo/hooks/post-receive > $line/hooks/post-receive; done | |
# | |
# Break down of the above command is below - don't try to run the bits | |
# on their own, you need to pipe the outputs between, like the example above | |
# | |
# List contentsfiles in current directory - full list view, row per file/folder | |
ls -la | |
# Only print the 9th column (folder 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
<DOCTYPE !html> | |
<html> | |
<head> | |
<title>Quick image check</title> | |
<style> | |
* { | |
font-family: sans-serif; | |
} | |
#dropzone, |
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 | |
# | |
# DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | |
# Version 2, December 2004 | |
# Copyright (C) 2004 Sam Hocevar <[email protected]> | |
# Everyone is permitted to copy and distribute verbatim or modified | |
# copies of this license document, and changing it is allowed as long | |
# as the name is changed. | |
# DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | |
# TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION |
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
<cfscript> | |
writeOutput('starting db source installation...<br/ >'); | |
function createDSN( name ) { | |
// Login is always required. This example uses two lines of code. | |
adminObj = createObject("component","cfide.adminapi.administrator"); | |
adminObj.login("pete", "admin"); | |
// Instantiate the data source object. | |
myObj = createObject("component","cfide.adminapi.datasource"); | |
// Create a DSN. |
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
<cfscript> | |
obj_query = new core.utility.queryWrapper(); | |
lst_columns = 'id,email'; | |
lst_columns_for_sql = listQualify(lst_columns, "`" ); | |
str_select = ' | |
SELECT #lst_columns_for_sql# | |
FROM `allcars`.`users` |
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 | |
################################ | |
# to use the tracker: | |
# call the track script, using the full path to the script | |
# and also give it an action string, and a script string | |
# | |
# $REPO_PATH"bin/track.sh" "completed thing" $REPO_PATH"task_one" | |
# | |
# /path/to/script/bin/track.sh "action that happened" "script/that/is/doing/things" |
OlderNewer