Skip to content

Instantly share code, notes, and snippets.

View willwade's full-sized avatar
🌏
Working on dasher and a lot of Ace hardware projects

will wade willwade

🌏
Working on dasher and a lot of Ace hardware projects
View GitHub Profile
@willwade
willwade / willwade-quix-cmds
Created March 24, 2010 17:02
My quix commands as cloned from Merlin Mann
> Merlin Mann's Custom Quix Commands
> TITLE: mann-quix-d.txt
> REMARKS: Hello, world. Under construction. Dilute! Dilute!
> GITHUB: http://gist.github.com/290059
> MORE: http://quixapp.com
> UPDATED: 2010-02-07_13-07-54
@Merlin Mann's Custom Quix Commands
@May organize these better once they all stabilize
bit javascript:var%20e=document.createElement('script');e.setAttribute('language','javascript');e.setAttribute('src','http://bit.ly/bookmarklet/load.js');document.body.appendChild(e);void(0); Make a bit.ly link
gcal javascript:var%20s;if(window.getSelection){s=window.getSelection();}else{s=document.selection.createRange().text;}var%20t=prompt('Please%20enter%20a%20description%20for%20the%20event',s);if(t){void(window.open(encodeURI('http://www.google.com/calendar/event?ctext='+t+'&action=TEMPLATE&pprop=HowCreated%3AQUICKADD'),'gcal'));}else{void(s);} Add event to Google Calendar
@willwade
willwade / AdaptechParse.py
Created March 11, 2012 07:49
Collection of AT Software - Parse a bunch of URLs for Software to import
#!/usr/bin/env python
# Need unicodecsv seen here http://docs.python.org/library/csv.html?highlight=csv#csv
# Date: Jan 2012
# -*- coding: iso-8859-15 -*-
from urllib2 import urlopen
from lxml import etree
import csv
from unicodecsv import UnicodeWriter
@willwade
willwade / FixDrupalCollation.php
Created March 11, 2012 07:51
Fix Drupal Tables collation encoding
<?php
// your connection
mysql_connect("localhost","root","root");
mysql_select_db("iosaac");
// convert code
$res = mysql_query("SHOW TABLES");
while ($row = mysql_fetch_array($res))
{
foreach ($row as $key => $table)
@willwade
willwade / iOSAppLister.php
Created March 11, 2012 07:54
A small script to get a list of all the Apps on your iOS device. Read the body for more info
<?php
if($_SERVER['REQUEST_METHOD'] == "POST") {
$filen = $_FILES['ufile'];
$allowedExtensions = array("deviceinfo", "xml", "txt");
function isAllowedExtension($fileName) {
global $allowedExtensions;
return in_array(end(explode(".", $fileName)), $allowedExtensions);
}
@willwade
willwade / removemacfiles.sh
Created March 11, 2012 07:56
Remove mac files from a dir
#!/bin/sh
find . -name .DS_Store -o -name .Trashes -o -name ._* -exec rm -rf {} \; -prune
@willwade
willwade / gist:2015511
Created March 11, 2012 08:00
My local .bash_profile
# aliases
alias bakesite=~/Sites/cake.attendance/cake/console/cake
alias cd..="cd .."
alias l="ls -al"
alias lp="ls -p"
alias h=history
alias reload='source ~/.bashrc'
#php/apache settings
alias phpmamp=/Applications/MAMP/bin/php5.3/bin/php
@willwade
willwade / ToggleProxy.vbs
Created March 11, 2012 08:01
Toggle Proxy Server On/Off
Const HKEY_CURRENT_USER = &H80000001
strComputer = "."
Set objRegistry = GetObject("winmgmts:\\" & strComputer & "\root\default:StdRegProv")
strKeyPath = "SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings"
strValueName = "ProxyEnable"
objRegistry.GetDWORDValue HKEY_CURRENT_USER, strKeyPath, strValueName, dwValue
if dwValue=0 then
dwValue=1
else
dwValue=0
@willwade
willwade / lexicontocsv.php
Created March 11, 2012 08:19
LexiconToCSV - Convert a binary file to a csv of words
<?php
$error = "";
$done = false;
if($_FILES){
$source = file_get_contents($_FILES['ufile']['tmp_name']);
unlink($_FILES['ufile']['tmp_name']);
preg_match_all("|([a-zA-Z ']{2,})|i",$source,$out);
if(is_array($out[1])){
@willwade
willwade / getlinks.php
Created March 11, 2012 08:31
Get a list of links from a page
@willwade
willwade / jsonToCSV.php
Created March 11, 2012 08:32
JSON to CSV
<?php
error_reporting(E_ALL);
$json_string = file_get_contents('pass.json');
$json_decode = json_decode2($json_string);
var_dump($json_decode);
exit;
$csvstring = "'" . implode("','", $json_decode) . "'";
echo $csvstring;