Skip to content

Instantly share code, notes, and snippets.

Avatar
🕶️
busy, busy

Mike Bijon mbijon

🕶️
busy, busy
View GitHub Profile
View git-largefiles.sh
#!/bin/bash
#set -x
# Shows you the largest objects in your repo's pack file.
# Written for osx.
#
# @see http://stubbisms.wordpress.com/2009/07/10/git-script-to-show-largest-pack-objects-and-trim-your-waist-line/
# @author Antony Stubbs
# set the internal field spereator to line break, so that we can iterate easily over the verify-pack output
@mbijon
mbijon / gist:8875213
Created Feb 8, 2014
git checkout/clone over the top of an existing set of files
View gist:8875213
git clone --no-checkout repo-address subdir/tmp
mv subdir/tmp/.git subdir/.git/ # final "/" important
rm -Rf subdir/tmp
cd subdir
git reset --hard HEAD
@mbijon
mbijon / php.partial.ini
Created Mar 22, 2014
XDebug config for verbose debugging info
View php.partial.ini
[XDebug]
zend_extension = "C:\xampp\php\ext\php_xdebug.dll"
xdebug.collect_params = 2
xdebug.collect_return = 1
xdebug.collect_vars = 0
xdebug.overload_var_dump = 1
xdebug.show_local_vars = 1
xdebug.profiler_append = 0
View php.partial.ini
[APC]
; Whether the CLI web server uses ANSI color coding in its terminal output.
apc.enabled=1
apc.shm_segments=1
apc.shm_size=256M
;Relative to the number of cached files (you may need to watch your stats for a day or two to find out a good number)
apc.num_files_hint=7000
;Relative to the size of WordPress
@mbijon
mbijon / return_output.htm
Last active Aug 29, 2015
Test code & results: Tugboat Yards API + WordPRess HTTP API
View return_output.htm
=== Whooo PLACEMENTS ===
array(5) {
["headers"]=> array(7) {
["content-type"]=> string(16) "application/json"
["date"]=> string(29) "Fri, 23 May 2014 04:32:20 GMT"
["server"]=> string(20) "nginx/1.4.6 (Ubuntu)"
["strict-transport-security"]=> string(16) "max-age=31536000"
["x-forwarded-proto"]=> string(5) "https"
["content-length"]=> string(3) "469"
["connection"]=> string(5) "Close"
View git-prune-tags.rb
#!/usr/bin/env ruby
require 'readline'
def prompt(prompt="> ")
input = nil
prompt += " " unless prompt =~ /\s$/
loop do
input = Readline.readline(prompt)
break if input.length > 0
end
@mbijon
mbijon / getOperators.request.xml
Last active Aug 29, 2015
TAB Ratings API: example SOAP request: 1st two versions for getMarket() method, 3rd & following versions work with getOperators() method
View getOperators.request.xml
<soapenv:Envelope xmlns:eyes="http://ads.eyesonratings.com/eyeson" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Header>
<wsse:Security soapenv:mustUnderstand="1" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
<wsse:UsernameToken wsu:Id="UsernameToken-AFF5317EC8B51F3253140417628900000">
<wsse:Username>USERNAME</wsse:Username>
<wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">PASSWORD</wsse:Password>
<wsse:Nonce EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary">a1RMQXpEakg1ajZJV0VUTQ==</wsse:Nonce>
<wsu:Created>2014-07-01T0:58:09.000Z</wsu:Created>
</wsse:UsernameToken>
</wsse:Security>
View group_expire.py
'''
This is a module that defines some helper classes and functions for
expiring groups of related keys at the same time.
Written July 1-2, 2013 by Josiah Carlson
Released into the public domain
'''
import time
View gist:62c465907577e8044df4
<?php
/*
Usage:
$frag = new CWS_Fragment_Cache( 'unique-key', 3600 ); // Second param is TTL
if ( !$frag->output() ) { // NOTE, testing for a return of false
functions_that_do_stuff_live();
these_should_echo();
// IMPORTANT
$frag->store();
// YOU CANNOT FORGET THIS. If you do, the site will break.
View yolo.php
<?php
class React_YOLO {
public function __construct() {
add_action( 'admin_menu', array( $this, 'admin_menu' ) );
}
public function admin_menu() {
add_menu_page( 'React', 'React', 'edit_posts', 'react', array( $this, 'page' ) );
}
You can’t perform that action at this time.