Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View ozh's full-sized avatar
🍷
More wine, please.

྅༻ Ǭɀħ ༄༆ཉ ozh

🍷
More wine, please.
View GitHub Profile
<?php
/*
How To Mirror Remote Images On Tumblr With WordPress
*/
// URL of the image you want to mirror. Here: Girl in pink underwear.
$image = 'http://i.imgur.com/Hq4QA.jpg';
// URL of the Tumblr API
$api = 'http://www.tumblr.com/api/write';
<?php
/*
How To Locally Mirror Remote Images With WordPress
*/
// URL of the image you want to mirror. Girl in pink underwear for instance.
$image = 'http://i.imgur.com/Hq4QA.jpg';
// GET request
@ozh
ozh / listsites
Created August 23, 2012 06:38
Find web directories ("name dot extension") in home dir (Dreamhost hosting style)
find ~/ -maxdepth 1 -type d \( -name "*.*" ! -name ".*" \)
@ozh
ozh / utor.bat
Created August 31, 2012 12:23
Start GTor if not running already then utorrent
@echo off
tasklist /FI "IMAGENAME eq Gtor.exe" 2>NUL | find /I /N "Gtor.exe">NUL
if %ERRORLEVEL%==1 start D:\online\GreedyTorrent\GTor.exe
start D:\online\utorrent\uTorrent.exe /MINIMIZED
exit
@ozh
ozh / gist:3928158
Created October 21, 2012 19:17
YOURLS to TweetButton
javascript:(function(){var d=document,s=d.createElement('script');window.yourls_callback=function(r){if(r.short_url){javascript:window.open('https://twitter.com/intent/tweet?text='+encodeURIComponent(' '+r.short_url+' '+d.title.replace(/^[ ]+|[ ]+$/g, '')),'Tweet','width=400,height=260');}else{alert('An error occured: '+r.message);}};s.src='http://u.vanu.jp/admin/index.php?u='+encodeURIComponent(d.location.href)+'&jsonp=yourls';void(d.body.appendChild(s));})();
@ozh
ozh / disable-plugins-when-doing-local-dev.php
Created November 7, 2012 16:44 — forked from johnpbloch/disable-plugins-when-doing-local-dev.php
Disables specified WordPress plugins when doing local development
<?php
/*
Plugin Name: Disable plugins when doing local dev
Description: If the WP_LOCAL_DEV constant is true, disables plugins that you specify
Version: 0.1
License: GPL version 2 or any later version
Author: Mark Jaquith
Author URI: http://coveredwebservices.com/
*/
@ozh
ozh / gist:4032822
Created November 7, 2012 16:49 — forked from markjaquith/gist:2628225
Script to sync WordPress SVN to GitHub
#!/bin/bash
# cd into the directory
cd ~/gitsync/github-wordpress-sync/;
# Make sure we are not already running
if [ -f .sync-running ];then
if test ! `find ".sync-running" -mmin +10`;then
# Currently running, but not stuck
exit 1;
fi
fi;
@ozh
ozh / gist:4032945
Created November 7, 2012 16:57
Change committer name in git
git filter-branch --commit-filter '
if [ "$GIT_COMMITTER_NAME" = "<Old Name>" ];
then
GIT_COMMITTER_NAME="<New Name>";
GIT_AUTHOR_NAME="<New Name>";
GIT_COMMITTER_EMAIL="<New Email>";
GIT_AUTHOR_EMAIL="<New Email>";
git commit-tree "$@";
else
git commit-tree "$@";
@ozh
ozh / Directory.reg
Created November 9, 2012 20:46
Regedit keys: Git GUI & Git Bash context menus
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Directory\Background\shell\git]
@="* Guit Bash"
"NoWorkingDirectory"=""
[HKEY_CLASSES_ROOT\Directory\Background\shell\git\command]
@="C:\\Program Files (x86)\\Console2\\Console.exe -t \"Git\" -d \"%V\""
[HKEY_CLASSES_ROOT\Directory\Background\shell\git_gui]
@ozh
ozh / config.md
Created November 13, 2012 17:54
my Console2 config

My Console2 config. Each section of Settings detailed below, entire console.xml file after that

Console

Window Size: 30 rows, 115 columns

Appearance

Uncheck "Snap to desktop edges" !