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
> 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 |
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
#!/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 |
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
<?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) |
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
<?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); | |
} |
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 | |
find . -name .DS_Store -o -name .Trashes -o -name ._* -exec rm -rf {} \; -prune |
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
# 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 |
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
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 |
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
<?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])){ |
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
<?php | |
$url = "http://en.wikipedia.org/wiki/Occupational_therapy"; | |
$input = @file_get_contents($url) or die("Could not access file: $url"); | |
$regexp = "<a\s[^>]*href=(\"??)([^\" >]*?)\\1[^>]*>(.*)<\/a>"; | |
if(preg_match_all("/$regexp/siU", $input, $matches)) { | |
# $matches[2] = array of link addresses | |
# $matches[3] = array of link text - including HTML code | |
foreach($matches[2] as $link) | |
{ |
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
<?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; |
OlderNewer