Skip to content

Instantly share code, notes, and snippets.

if ($this->posts[0]->tumblr_url) {
header( "Location: " . $this->posts[0]->tumblr_url, true, 301);
exit;
}
}
// Put sticky posts at the top of the posts array
"wp-includes/query.php" 4399 lines --76%--
@ku
ku / gist:1fd091b52123e4b5dd00
Created June 24, 2014 02:21
US top 100 sites(except NSFW)
us_top_100_sites = %w(
http://google.com/ http://facebook.com/ http://youtube.com/ http://yahoo.com/ http://amazon.com/
http://wikipedia.org/ http://linkedin.com/ http://ebay.com/ http://twitter.com/ http://craigslist.org/
http://bing.com/ http://pinterest.com/ http://blogspot.com/ http://live.com/ http://go.com/
http://instagram.com/ http://cnn.com/ http://paypal.com/ http://tumblr.com/ http://reddit.com/
http://imgur.com/ http://espn.go.com/ http://huffingtonpost.com/ http://wordpress.com/ http://netflix.com/
http://yelp.com/ http://msn.com/ http://apple.com/ http://imdb.com/ http://weather.com/
http://aol.com/ http://microsoft.com/ http://chase.com/ http://nytimes.com/ http://bankofamerica.com/
http://godaddy.com/ http://zillow.com/ http://buzzfeed.com/ http://about.com/ http://walmart.com/
http://foxnews.com/ http://secureserver.net/ http://ask.com/ http://wellsfargo.com/
@ku
ku / copen
Last active August 29, 2015 14:02
open circleCI
#!/bin/sh
GIT='git'
if test `uname` = "Darwin" ; then
SED_OPT='-E'
OPEN='open'
else
SED_OPT='-r'
OPEN=''
@ku
ku / json
Created April 18, 2014 11:40
json parser
#!/usr/bin/env node
var json = ''
process.stdin.on('readable', function(chunk) {
var chunk = process.stdin.read();
json += chunk
if (chunk !== null) {
var r = JSON.parse(json)
r = JSON.stringify(r, null, ' ');
console.log(r);
@ku
ku / metatag.m
Created November 12, 2013 02:19
OSX10.9 tag manipulation util
#import <Foundation/Foundation.h>
#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
// clang tag.m -o metatag -framework "foundation" -fobjc-arc && ./metatag
int main(int argc, char **argv) {
char *tagToAdd = NULL;
Delivered-To: [email protected]
Received: by 10.194.239.134 with SMTP id vs6csp69974wjc;
Mon, 21 Jan 2013 16:01:34 -0800 (PST)
Return-Path: <[email protected]>
Received-SPF: pass (google.com: domain of [email protected] designates 10.194.21.70 as permitted sender) client-ip=10.194.21.70
Authentication-Results: mr.google.com;
spf=pass (google.com: domain of [email protected] designates 10.194.21.70 as permitted sender) [email protected];
dkim=pass [email protected]
X-Received: from mr.google.com ([10.194.21.70])
@ku
ku / gist:3880876
Created October 12, 2012 19:03
esmangle log
./web/js/vendor/underscore.js
/Users/kentaro.kumagai/uglify-server/node_modules/esmangle/esmangle.js:432
if (!this.set.hasOwnProperty(name)) {
^
TypeError: Property 'hasOwnProperty' of object #<error> is not a function
at Scope.define (/Users/kentaro.kumagai/uglify-server/node_modules/esmangle/esmangle.js:432:27)
@ku
ku / gist:3096335
Created July 12, 2012 06:49
PHP severity values
E_ERROR : 1
E_WARNING : 2
E_PARSE : 4
E_NOTICE : 8
E_CORE_ERROR : 16
E_CORE_WARNING : 32
E_COMPILE_ERROR : 64
E_COMPILE_WARNING : 128
E_USER_ERROR : 256
E_USER_WARNING : 512
@ku
ku / gist:3027463
Created July 1, 2012 08:00
remove git untracked files
#!/bin/sh
dir=`pwd`
while true ; do
if test -d "$dir/.git"
then
break
else
dir=`dirname $dir`
if test "$dir" = "/"
@ku
ku / gist:2367347
Created April 12, 2012 13:38
closure compiler exception reproduce code
try {
} catch (e) {
}
res.map(function(r) {
if (e = r != null ? r.error : void 0) {
}
});