Skip to content

Instantly share code, notes, and snippets.

#!/bin/sh
if [ $# -ne 1 ]; then
echo "require basename";
exit;
fi
TARGET=$1;
cp -R $TARGET-armv6 $TARGET;
#!/usr/bin/env perl
use strict;
use warnings;
use Plack::Builder;
use AnyEvent;
use Cache::LRU;
use Sys::Virt;
use JSON;
use Data::Section::Simple qw/ get_data_section /;
#!/usr/bin/env perl
use strict;
use warnings;
use lib 'lib';
use MyApp;
my $app = MyApp->new;
$app->setup;
@mala
mala / gist:1071708
Created July 8, 2011 12:19
Furlでローカルアドレスへのアクセス禁止したい
# FurlX::ParanoidAgent 的なやつ
my $furl = Furl->new(
inet_aton => \&_inet_aton,
);
sub _inet_aton {
my $addr = Net::DNS::Lite::inet_aton(@_);
if (is_local_addr($addr)) { return }
$addr;
@sprhawk
sprhawk / gist:2779208
Created May 24, 2012 03:06
git diff localizable.strings
(from :http://www.entropy.ch/blog/Developer/2010/04/15/Git-diff-for-Localizable-strings-Files.html)
First, add this to the project’s .git/info/attributes file:
+
*.strings diff=localizablestrings
(Unfortunately you do have to add it to every project, there doesn’t seem to be a global attributes configuration file)
Second, add this to your ~/.gitconfig file:
@domenic
domenic / promises.md
Last active March 31, 2024 14:07
You're Missing the Point of Promises

This article has been given a more permanent home on my blog. Also, since it was first written, the development of the Promises/A+ specification has made the original emphasis on Promises/A seem somewhat outdated.

You're Missing the Point of Promises

Promises are a software abstraction that makes working with asynchronous operations much more pleasant. In the most basic definition, your code will move from continuation-passing style:

getTweetsFor("domenic", function (err, results) {
 // the rest of your code goes here.
@ole
ole / update_storyboard_strings.sh
Last active April 4, 2022 06:11
Automatically extract translatable strings from Xcode storyboards and update .strings files. Original version by MacRumors forum user mikezang (http://forums.macrumors.com/showpost.php?p=16060008&postcount=4). Slightly updated by Ole Begemann. NOTE: this Gist moved to a regular repo at https://github.com/ole/Storyboard-Strings-Extraction.
# (File moved to https://github.com/ole/Storyboard-Strings-Extraction)
//
// WirelessBandManager.m
// CmdScanner
//
// Created by Andras Kovi on 2013.04.05..
#import <Foundation/Foundation.h>
#import <IOBluetooth/IOBluetooth.h>
@atenni
atenni / README.md
Last active June 20, 2024 22:30
How to permalink to a gist's raw file

Problem: When linking to the raw version of a gist, the link changes with each revision.

Solution:

To return the first file from a gist: https://gist.github.com/[gist_user]/[gist_id]/raw/

To get a file from multi–file gist: https://gist.github.com/[gist_user]/[gist_id]/raw/[file_name]

@tonyhb
tonyhb / main.go
Created June 20, 2013 00:19
Golang: Converting a struct to a map (to a url.Values string map)
package main
import (
"fmt"
"net/url"
"reflect"
"strconv"
)
type Person struct {