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
// build the hash | |
var current_timestamp = ((new Date()).getTime() / 1000).toFixed(); | |
postman.setEnvironmentVariable('this_timestamp', current_timestamp ); | |
postman.setEnvironmentVariable('this_nonce', Math.floor( Math.random() * 10000 )); | |
// the message is made up of the order/filter etc params | |
// params need to be put into alphabetical order | |
var current_message = ''; | |
var query_params = postman.__execution.request.url.query; |
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 | |
# change directory to the path passed from cf | |
# then do a git log, oneline to avoid commit messages (I had to specify the full path to git) | |
# pipe that to "head" and limit it to 1 line | |
# this will give us "HASH MESSAGE" | |
# use awk to print the first "column" -> HASH | |
cd $1 && /usr/local/git/bin/git log --oneline | head -n 1 | awk '{print $1}' |
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
# add this to your ~/.bashrc | |
# then as long as you're inside an httpdocs folder (e.g. /var/www/vhosts/example/httpdocs/my/awesome/tool) | |
# you can go like this: | |
# git add . | |
# git status (to be safe now) | |
# git_quick_commit I done some stuff | |
# | |
# and you'll get a commit message like: | |
# 45dcc35 my > awesome > tool: I done some stuff | |
# |
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
@rem save this file somewhere, then create shortcut like this | |
@rem C:\Windows\System32\cmd.exe /c "C:\path\to\fixnetwork.bat" | |
netsh interface show interface | |
@echo on | |
@rem Disable the adapter - make sure the quoted name matches your adapter name | |
netsh interface set interface "INSERT NETWORK ADAPTER NAME HERE" DISABLED | |
@rem Wait 2 seconds before re-enabling (again adapter names must be correct) | |
timeout /t 2 |
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
// simply returns a single random number | |
const singleRandom = function singleRandom() { | |
return (Math.random() * 10).toFixed(0); | |
}; | |
/* | |
accept a mask of seperators, e.g. / or //:: | |
and return the mask strings surrounded by numbers. | |
- if the seperator changes, add a space | |
- / becomes X/Y |
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
-- this was written for mysql to show how TRUNCATE does more than just DELETE all the rows | |
-- make sure you have a `test` database and a user with permissions to CREATE tables | |
DROP TABLE `test`.`test`; | |
CREATE TABLE `test`.`test` | |
( | |
`id` INT(11) PRIMARY KEY AUTO_INCREMENT NOT NULL, | |
`name` VARCHAR(32) NOT NULL | |
); |
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
/** | |
* update quantity based on button type | |
* make sure we don't go below zero | |
*/ | |
if( action_type === 'minus' ) { | |
// this returned my value, then decremented it, so it never saved | |
// hitting the minus button always resulted in the same number | |
quantity = quantity ? quantity-- : 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
#################################### | |
# # | |
# Example queries to demonsrate # | |
# how SELECTing a NULL value is # | |
# converting it into a 0 during a # | |
# INSERT...SELECT statement # | |
# # | |
#################################### | |
# recreate an empty example price table |
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
/* | |
this script relies on a spreadsheet being called "test desc" and a pdf being called "test.pdf" | |
there needs to be a description in cell A1 of "test desc" | |
*/ | |
function setNewDescription(file_id,description){ | |
var file_by_id = DriveApp.getFileById(file_id); | |
Logger.log(file_by_id.getDescription()); |
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" |
NewerOlder