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 | |
# checkdns | |
# A very simple dig tool for checking DNS propagation with Google Public DNS and OpenDNS after migrating servers | |
# | |
# INSTRUCTIONS | |
# Put this in your ~/bin folder, make it executable and run it by typing "checkdns" in your command line | |
read -p "Enter domain: " domain | |
# Google Public DNS |
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 setWeatherIcon(condid) { | |
switch(condid) { | |
case '0': var icon = '<i class="wi-tornado"></i>'; | |
break; | |
case '1': var icon = '<i class="wi-storm-showers"></i>'; | |
break; | |
case '2': var icon = '<i class="wi-tornado"></i>'; | |
break; | |
case '3': var icon = '<i class="wi-thunderstorm"></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
Each YouTube video has 4 generated images. They are predictably formatted as follows: | |
http://img.youtube.com/vi/<insert-youtube-video-id-here>/0.jpg | |
http://img.youtube.com/vi/<insert-youtube-video-id-here>/1.jpg | |
http://img.youtube.com/vi/<insert-youtube-video-id-here>/2.jpg | |
http://img.youtube.com/vi/<insert-youtube-video-id-here>/3.jpg | |
The first one in the list is a full size image and others are thumbnail images. The default thumbnail image (ie. one of 1.jpg, 2.jpg, 3.jpg) is: | |
http://img.youtube.com/vi/<insert-youtube-video-id-here>/default.jpg |
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
curl "http://www.gratisography.com/pictures/[1-88]H.jpg" -o "#1.jpg" |
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 java.io.BufferedInputStream; | |
import java.net.URL; | |
import java.net.URLConnection; | |
import org.json.JSONArray; | |
import org.json.JSONObject; | |
protected void foo () { | |
// The input stream from the JSON response | |
BufferedInputStream buffer = 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
function setWeatherIcon(condid) { | |
var icon = ''; | |
switch(condid) { | |
case '0': icon = 'wi-tornado'; | |
break; | |
case '1': icon = 'wi-storm-showers'; | |
break; | |
case '2': icon = 'wi-tornado'; | |
break; | |
case '3': icon = 'wi-thunderstorm'; |
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
/** | |
* Use reflection to shallow copy simple type fields with matching names from one object to another | |
* @param fromObj the object to copy from | |
* @param toObj the object to copy to | |
*/ | |
public static void copyMatchingFields( Object fromObj, Object toObj ) { | |
if ( fromObj == null || toObj == null ) | |
throw new NullPointerException("Source and destination objects must be non-null"); | |
Class fromClass = fromObj.getClass(); |
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 setWeatherIcon(condid) { | |
var icon = ''; | |
switch(condid) { | |
case '0': icon = 'wi-tornado'; | |
break; | |
case '1': icon = 'wi-storm-showers'; | |
break; | |
case '2': icon = 'wi-tornado'; | |
break; | |
case '3': icon = 'wi-thunderstorm'; |
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 buttons; | |
buttons = document.getElementsByClassName('_42ft'); | |
for (var i = 0; i < buttons.length; i++) { | |
if(buttons[i].getAttribute('ajaxify') != null){ | |
if(buttons[i].getAttribute('ajaxify').indexOf('invite') != -1){ | |
buttons[i].click(); | |
} | |
} | |
} |
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 | |
# ngrok's web interface is HTML, but configuration is bootstrapped as a JSON | |
# string. We can hack out the forwarded hostname by extracting the next | |
# `*.ngrok.io` string from the JSON | |
# | |
# Brittle as all get out--YMMV. If you're still reading, usage is: | |
# | |
# $ ./ngrok_hostname.sh <proto> <addr> | |
# |
OlderNewer