Skip to content

Instantly share code, notes, and snippets.

View mAster-rAdio's full-sized avatar

Master Radio mAster-rAdio

View GitHub Profile
@washingtontimes
washingtontimes / git-status-u.sh
Created March 16, 2010 10:18
A git command that emulates svn status -u and shows what will be updated with the next pull.
#!/bin/bash
git fetch
git log --name-status ..origin/master | grep -P '[ACDMRTUXB]\t'
@kamipo
kamipo / gist:474214
Created July 13, 2010 17:34
munin.psgi
use strict;
use warnings;
use Plack::Builder;
use Plack::App::Directory;
use Munin;
use Date::Manip;
use POSIX qw(strftime);
use File::Slurp;
my $GRAPHER = "/usr/share/munin/munin-graph";
@kamipo
kamipo / innobackupex-1.5.1.diff
Created January 6, 2011 11:02
innobackupexをtritonnに対応させるよ!
--- innobackupex-1.5.1.org 2010-12-09 23:03:09.000000000 +0900
+++ innobackupex-1.5.1 2011-01-07 01:28:20.000000000 +0900
@@ -1333,10 +1333,19 @@
print FILE "CHANGE MASTER TO MASTER_LOG_FILE='$filename', MASTER_LOG_POS=$position\n";
close(FILE);
+ my $orig_datadir = get_option(\%config, 'mysqld', 'datadir');
+
if ($option_stream eq 'tar') {
+ system("cd $orig_datadir; tar chf - master.info")
@aaroneaton
aaroneaton / php.snippets
Created March 10, 2011 20:08
CodeIgniter PHP snippets for the VIM plugin SnipMate
# SnipMate is required to use snippets
# Download SnipMate: http://www.vim.org/scripts/script.php?script_id=2540
# Put this file in ~/.vim/snippets/ then restart vim
# This snippet file includes many useful snippets for CodeIgniter. Please feel free to fork and contribute!
snippet php
<?php
${1}
?>
snippet ec
echo "${1:string}"${2};
@sgk
sgk / trac2down.py
Created October 14, 2011 09:35
Trac Wiki to Markdown converter
#!/usr/bin/python
# vim:set fileencoding=utf-8 sw=2 ai:
import sqlite3
import datetime
import re
SQL = '''
select
name, version, time, author, text
@koyhoge
koyhoge / single_execution.php
Created December 8, 2011 12:54
single_exection patched by koyhoge
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
// created by bto
// via http://blog.bz2.jp/archives/2008/05/1php.html
// http://blog.bz2.jp/archives/2008/05/singleexecution.html
class singleExecution
{
var $key = null;
var $options = array(
@pasberth
pasberth / easy_regexp.rb
Created December 10, 2011 15:57
Rubyだったらこんなに楽に正規表現を書けるよ!!
# -*- coding: utf-8 -*-
# Rubyだったら正規表現はすごい簡単だよ!!!
# 他の言語ではいくつかパターンがありますが、自分はRubyほど楽に正規表現を利用できる言語を知りません。
msg = "まなさん大好き"
# Ruby では正規表現リテラルがあります。
# // のリテラルはそれだけで正規表現のリテラルです
# かなりperl的なのです^q^
@andrewrcollins
andrewrcollins / trim.awk
Created January 11, 2012 04:22
ltrim(), rtrim(), and trim() in awk
function ltrim(s) { sub(/^[ \t\r\n]+/, "", s); return s }
function rtrim(s) { sub(/[ \t\r\n]+$/, "", s); return s }
function trim(s) { return rtrim(ltrim(s)); }
BEGIN {
# whatever
}
{
# whatever
}
END {
@riywo
riywo / gist:1681604
Created January 26, 2012 07:56
llinstallとllenvでikachan入れる
$ curl -kL https://raw.github.com/riywo/App-llenv/master/llenv-install | bash
and add your .bashrc or something
export LLENV_ROOT=$HOME/llenv
export LLENV_OSTYPE=`$LLENV_ROOT/bin/ostype`
export PATH=$LLENV_ROOT/bin:$PATH
$ llinstall init perl
$ llinstall install perl perl-5.14.2
@menny
menny / verify_appstore_in_app.php
Last active February 15, 2024 14:45
How to verify in-app purchases from AppStore and Market in PHP code (server-side)
function verify_app_store_in_app($receipt, $is_sandbox)
{
//$sandbox should be TRUE if you want to test against itunes sandbox servers
if ($is_sandbox)
$verify_host = "ssl://sandbox.itunes.apple.com";
else
$verify_host = "ssl://buy.itunes.apple.com";
$json='{"receipt-data" : "'.$receipt.'" }';
//opening socket to itunes