View odd-even.sh
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
# usage: odd numbers.txt | |
function odd() { | |
# print odd lines from file | |
awk 'NR%2==1 {print}' $1 | |
} | |
function even() { | |
# print even lines from file | |
awk 'NR%2==0 {print}' $1 |
View pageres-mogrify.sh
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
pageres 1024x768 < urls.txt ; mogrify -resize 474 -crop 474x501+0+0 *.png | |
# Go get screenshots from list in clipboard | |
# Once that's done, resize all the images | |
# and crop them | |
# And then optimise them: /Applications/ImageOptim.app/Contents/MacOS/ImageOptim *.png |
View Code.gs
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
function myFunction() { | |
var response = UrlFetchApp.fetch("http://www.example.com/get-modx-latest-version.php"); | |
SpreadsheetApp.getActiveSheet().getRange('A1').setValue(response.getContentText()); | |
} |
View check-url-status.rb
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
File.foreach('URLS.txt') { |l| | |
system("curl -sL -w '%{http_code} %{url_effective}\\n' '#{l.chomp}' -o /dev/null") | |
} |
View gist:9366311
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 foo = function() { | |
var a = 3, b = 5; | |
console.log("a: " + a + ", b: " + b); | |
if (typeof c === "undefined") { console.log("c is undefined"); } | |
console.log("---"); | |
var bar = function() { | |
var b = 7, c = 11; | |
View url-grabber.rb
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
require 'rubygems' | |
require 'spidr' | |
links = [] | |
wesite = "http://www.website.com" | |
puts "Scanning #{website} for links" | |
puts "" | |
f = File.open("urls.txt","w"); |
View bookmarklet
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
data:text/html,%20%3Ctitle%3EText%20Editor%3C/title%3E%3Cbody%20contenteditable%20style=%22font-size:2rem;line-height:1.4;max-width:60rem;%20font-family:%20Consolas;%20margin:0%20auto;padding:4rem;%22%3E |
View gist:3946402
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
diff -rq folder1 folder2 | |
# show summary of differences | |
diff -r folder1 folder2 | |
# show full differences |
View gist:3097044
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
^[^@]*$ |
View gist:3096899
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
identify -verbose filename.jpg | grep "Quality" |
NewerOlder