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
<div id="wrapper"> | |
<span class="spinner"></span> | |
<span class="pulser"></span> | |
<span class="doublespinner"></span> | |
<span class="ball"></span> | |
</div> | |
<style type="text/css"> | |
body { | |
background: #333; |
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
<a href="#" data-tooltop="This is a tooltip!">a link</a> | |
<style type="text/css"> | |
a:hover:after { | |
content: attr(data-tooltip); | |
position: absolute; | |
top: 20px; | |
left: 0; | |
} | |
</style> |
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
#!/bin/bash | |
DIR="/Path/to/gh-pages/repo" # Path to gh-pages repo | |
URL="http://website.com" # Domain and path to where the GitHub Page lives on the web | |
BASE=`basename $1` | |
cp $1 $DIR | |
cd $DIR | |
git add $BASE | |
git commit -m "$BASE added" |
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
<?php | |
function getDirectoryList ($directory) { | |
// create an array to hold directory list | |
$results = array(); | |
// create a handler for the directory | |
$handler = opendir($directory); | |
// open directory and walk through the filenames | |
while ($file = readdir($handler)) { |
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
find . -name *.DS_Store -type f -exec rm {} ; |
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
string='My string'; | |
if [[ $string == *My* ]]; then | |
echo "It's there!"; | |
fi |
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 format_phone($phone) { | |
$prefix = null; | |
//Check if number has international prefix | |
switch(true){ | |
case substr($phone, 0, 1) == '+': | |
$phone = substr($phone, 1); | |
$prefix = '+'; | |
break; | |
case substr($phone, 0, 2) == '00': |
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
find SOURCE_DIR -print -name "*.jpg" -execdir convert -resize 800x800 -quality 80 '{}' 'TARGET_DIR/{}' ; | |
find Pictures/ -print -name "*.jpg" -execdir convert -resize 800x800 -quality 80 '{}' '/tmp/test/{}' ; |
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
require 'rubygems' | |
require 'pdf/reader' | |
class TotalPages | |
def count(dir) | |
@conv_directory = dir | |
## I output the directory argument as a test with the below line - | |
## mostly to make sure that passing '.' gets current dir | |
# puts @conv_directory |
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
require 'net/http' | |
require 'uri' | |
require "rexml/document" | |
# Retrieves US Location data based on a passed in Zipcode. Uses | |
# Google Maps geocoding service to retrieve a Hash of city, state, and zip | |
# For more info on the service see: <a href="http://code.google.com/apis/maps/documentation/geocoding/" >http://code.google.com/apis/maps/documentation/geocoding/</a> | |
# | |
# example: | |
# puts get_location_data(97030).inspect |
NewerOlder