Skip to content

Instantly share code, notes, and snippets.

@sosukeinu
sosukeinu / wp_query_args.php
Last active October 2, 2015 11:58 — forked from luetkemj/wp-query-ref.php
WP CONFIG wp_query $args
<?php
/**
* WordPress Query Comprehensive Reference
* Compiled by luetkemj - luetkemj.com
*
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query
* Source: http://core.trac.wordpress.org/browser/tags/3.3.1/wp-includes/query.php
*/
$args = array(
@sosukeinu
sosukeinu / ajaxify-html5.js
Created December 9, 2012 02:47
JAVASCRIPT/JQUERY Ajaxify a Website with the HTML5 History API using History.js, jQuery and ScrollTo
// History.js It!
// v1.0.1 - 30 September, 2012
// https://gist.github.com/854622
(function(window,undefined){
// Prepare our Variables
var
History = window.History,
$ = window.jQuery,
document = window.document;
@sosukeinu
sosukeinu / unix_tree.py
Created December 21, 2012 06:31
PYTHON Simple 'Unix Tree' script
import os
import sys
def getroot():
# If the length of 'sys.argv' is longer than one, index 1 is assumed to be
# root.
if len(sys.argv) == 1:
path = ''
else:
path = sys.argv[1]
@sosukeinu
sosukeinu / send-message.py
Created December 24, 2012 17:38 — forked from ser1zw/send-message.py
PYTHON send E-mail from eml file
#!/usr/bin/env python
# -*- mode: python; coding: utf-8-unix -*-
import sys
import os.path
import smtplib
if len(sys.argv) <= 2:
print('Usage:')
print(' $ python ' + sys.argv[0] + ' mailfrom rcptto <emlfile>')
print
@sosukeinu
sosukeinu / reset_featured_image_functions.php
Last active December 11, 2015 17:48 — forked from thefrosty/reset featured images
WP function reset featured images
@sosukeinu
sosukeinu / pythontidy.xml
Created January 25, 2013 20:11 — forked from witsch/pythontidy.xml
CONFIG PythonTidy Settings
<config>
<parm name="COL_LIMIT" value="int(79)" />
<parm name="SHEBANG" value="" />
<parm name="PARENTHESIZE_TUPLE_DISPLAY" value="bool(False)" />
<parm name="ADD_BLANK_LINES_AROUND_COMMENTS" value="bool(False)" />
<parm name="ADD_BLANK_LINE_AFTER_DOC_STRING" value="bool(False)" />
<parm name="MAX_SEPS_FUNC_DEF" value="int(99)" />
<parm name="MAX_SEPS_FUNC_REF" value="int(99)" />
<parm name="WRAP_DOC_STRINGS" value="bool(True)" />
<parm name="NORMALIZE_DOC_STRINGS" value="bool(True)" />
@sosukeinu
sosukeinu / Regex:IP
Created January 25, 2013 20:11 — forked from iLittleSheep/Regex:IP
Regex:IP
((?:(?:25[0-5]|2[0-4]\d|[01]?\d?\d)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d?\d))
@sosukeinu
sosukeinu / navbar-bootstrap.css
Created January 25, 2013 20:11 — forked from amyunus/navbar-bootstrap.css
Bootstrap navbar CSS
.navbar-inner {
}
.brand,
.nav > li > a {
}
.brand:hover,
.nav > li > a:hover {
}
.nav > li > a:focus,
.nav > li > a:hover {
@sosukeinu
sosukeinu / page_range.py
Created January 25, 2013 20:11 — forked from danshultz/page_range.py
PYTHON detecting consecutive integers in a list
# Ref from http://stackoverflow.com/questions/2361945/detecting-consecutive-integers-in-a-list
from itertools import groupby
from operator import itemgetter
class PageRange(object):
@staticmethod
def to_text_range(array_of_numbers):
text_buffer = []
@sosukeinu
sosukeinu / installed_packages.sh
Created January 25, 2013 20:11 — forked from pmbuko/installed_packages.sh
BASH list installed packages
#!/bin/bash
for log in $(/bin/ls -r /var/log/install.log*); do
bzgrep 'Writing receipt' $log | awk '{print $1,$2,$3,$10}'
done