Skip to content

Instantly share code, notes, and snippets.

@hirose31
hirose31 / gist:1006095
Created June 3, 2011 09:32
bash completion for dotcloud
### dotcloud 0.3.1
# must be load .bash_completion (http://bash-completion.alioth.debian.org/)
# before load this file.
# expire_in filename expire_seconds
# expire_in foo.cache 300 # return true if go by 5min from last modification.
expire_in() {
local file=$1
local expire=$2
import os
import csv
from subprocess import Popen, PIPE
from Foundation import NSMutableDictionary
build_number = os.popen4("git rev-parse --short HEAD")[1].read()
info_plist = os.environ['BUILT_PRODUCTS_DIR'] + "/" + os.environ['WRAPPER_NAME'] + "/Info.plist"
# Open the plist and write the short commit hash as the bundle version
plist = NSMutableDictionary.dictionaryWithContentsOfFile_(info_plist)
#!/usr/bin/env perl
use strict;
use warnings;
use Pod::Usage;
use Text::Markdown 'markdown';
use HTML::TreeBuilder;
use List::Util 'max';
<?php
/**
* @author Benjamin Lazarecki <benjamin.lazarecki@gmail.com>
* Date: 07/06/12
*/
namespace Widop\Mink\Extension;
trait PopupDictionary
@haranicle
haranicle / UniversalFrameworkMaker.sh
Last active October 27, 2015 01:29
A shell script to create an universal cocoa framework.
#!/bin/sh
FrameworkName="MyKitName"
rm -rf ./Debug
mkdir ./Debug
cp -r ./Debug-iphoneos/${FrameworkName}.framework ./Debug/${FrameworkName}.framework
lipo -create ./Debug-iphoneos/${FrameworkName}.framework/${FrameworkName} ./Debug-iphonesimulator/${FrameworkName}.framework/${FrameworkName} -output ./Debug/${FrameworkName}.framework/${FrameworkName}
@predominant
predominant / ubuntu-1104-nginx-base.sh
Created October 5, 2011 15:19
Install Ubuntu 11.04 Nginx based web server with PHP-FPM, MySQL and MongoDB
#!/bin/bash
###
#
# Copyright (c) 2011 Cake Development Corporation (http://cakedc.com)
#
# Ubuntu 11.04 based web server installation script
# Run this by executing the following from a fresh install of Ubuntu 11.04 server:
#
# bash -c "$(curl -fsSL https://raw.github.com/gist/1264701)" <mysqlPassword>
@ysaotome
ysaotome / PPTP_vpn_setup_for_centos64.sh
Last active December 20, 2015 03:59
CentOS 6.4 x86_64 に対してPPTPでVPNを構築するスクリプト。※DoCoMo SPモードではPPTP使えないので注意。
#!/bin/bash -x
# Description:PPTP for CentOS 6.4 64bit
# 2013/07/28 @ysaotome
(
### setting
/bin/cat << _SECRETS_ > /tmp/SECRETS_TMP.txt
#==============================================\n
# username auth_server password auth_ipaddress\n
"hoge001" "pptpd" "hoge##123" *\n
@anzfactory
anzfactory / MyEventObject.java
Last active March 26, 2016 05:47
NSNotificationCenterのようなことをandroidでもやるために
/**
* NSNotificationのようなもの
* 通知で送る情報が詰まったオブジェクト
*/
public class MyEventObject extends EventObject {
public static final String TAG = "MyEventObject";
public enum EventType {
Hoge,
<?php
function test($init, $key = 'a')
{
$var = $init;
$var[$key] = 1;
echo var_export($init, true), ': ', is_array($var) ? 1 : 0, "\n";
}
test(null); // OK
@think49
think49 / natsort-1.2.4.js
Last active November 3, 2017 21:07
natsort.js : 自然順アルゴリズムで配列をソート
/**
* natsort.js
* Sort an array using a "natural order" algorithm.
*
* @version 1.2.4
* @author think49
* @license http://www.opensource.org/licenses/mit-license.php (The MIT License)
* @url https://gist.github.com/660141
* @see <a href="http://sourcefrog.net/projects/natsort/">Natural Order String Comparison</a>
*/