Skip to content

Instantly share code, notes, and snippets.

View blainsmith's full-sized avatar
☠️

Blain Smith blainsmith

☠️
View GitHub Profile
@blainsmith
blainsmith / gist:1188666
Created September 2, 2011 14:04
Search Tumblr by Tag
$('input').keypress(function(event){
if(event.which == 13) {
var tag = $(this).val();
tag = tag.replace(' ', '_');
location.href = 'http://YOUR_TUMBLR_SITE/tagged/' + tag;
}
});
@blainsmith
blainsmith / proposed.html
Created April 17, 2012 14:23
Semantic Definition List
<dl>
<li>
<dt>My Term</dt>
<dd>This is the description of my term</dd>
</li>
<li>
<dt>First Term</dt>
</li>
@blainsmith
blainsmith / hosts
Created November 9, 2012 16:38
OSX/MAMP Localhost Development
# Custom Hosts
127.0.0.1 wordpress.dev
127.0.0.1 drupal.dev
127.0.0.1 webapp-a.dev
127.0.0.1 webapp-b.dev
#127.0.0.1 NEW-SITE.dev
@blainsmith
blainsmith / gitdoc.yml
Created December 4, 2012 20:08
GitDoc.me
FOO:
- https://github.com/blainsmith/Plugin-Gist
- https://github.com/gitlabhq/gitlabhq
PRd:
- https://github.com/j4mie/paris
- https://github.com/j4mie/idiorm

Twitter公式クライアントのコンシューマキー

Twitter for iPhone

Consumer key: IQKbtAYlXLripLGPWd0HUA
Consumer secret: GgDYlkSvaPxGxC4X8liwpUoqKwwr3lCADbz8A7ADU

Twitter for Android

Consumer key: 3nVuSoBZnx6U4vzUxf5w
Consumer secret: Bcs59EFbbsdF6Sl9Ng71smgStWEGwXXKSjYvPVt7qys

Twitter for iPad

Consumer key: CjulERsDeqhhjSme66ECg

@blainsmith
blainsmith / gist:5667031
Created May 28, 2013 23:58
Modify post type when using XML-RPC
function redirect_xmlrpc_to_custom_post_type ($data, $postarr) {
// This function detects a XML-RPC request and modifies it before posting
$p2_custom_post_type = 'FanPost'; // Define your Custom post type
if (defined('XMLRPC_REQUEST') || defined('APP_REQUEST')) {
$data['post_type'] = $p2_custom_post_type; // sets the request post type to custom post type instead of the default 'Post'.
return $data;
}
return $data;
@blainsmith
blainsmith / beast_mode.js
Last active December 18, 2015 04:09
Sample node script for listening for beast mode
self.on('beast mode', function(response){
response.raise(weight.max());
});
@blainsmith
blainsmith / labels.js
Created August 7, 2013 13:27
Javascript Stuff
// Break a loop
var i = 0;
theAnswerToTheUniverse: while ( true ) {
console.log( ++i );
if ( i === 42 ) break theAnswerToTheUniverse;
}
// Break an if
myTest: if ( condition ) {
// some code...
@blainsmith
blainsmith / constants.js
Created August 26, 2013 19:45
JavaScript Constant Variables with Object.freeze();
var CONST = {
API_KEY: '123456789abcdefg',
PI: 3.14
};
Object.freeze(CONST);
// Will print {API_KEY: "123456789abcdefg", PI: 3.14}
console.log(CONST);
// Attempt to change the value of PI to something else, but won't happen
@blainsmith
blainsmith / Preferences.sublime-settings
Created December 6, 2013 18:55
My user settings for Sublime Text
{
"create_window_at_startup": false,
"detect_indentation": false,
"hot_exit": false,
"remember_open_files": false,
"tab_size": 2,
"translate_tabs_to_spaces": true,
"draw_white_space": "all",