Skip to content

Instantly share code, notes, and snippets.

View dealforest's full-sized avatar

Toshihiro Morimoto dealforest

View GitHub Profile
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>net.bulknews.GitHubGrowler</string>
<key>ProgramArguments</key>
<array>
<string>絶対パス /github-growler/github-growler.pl</string>
<string>ここに UserID </string>
--- mark.c.orig 2009-06-25 02:03:01.000000000 +0900
+++ mark.c 2009-06-25 02:03:50.000000000 +0900
@@ -59,6 +59,8 @@
static void MarkRedisplayLine __P((int, int, int, int));
static int MarkRewrite __P((int, int, int, struct mchar *, int));
+void pbcopy(const char *strings);
+
extern struct layer *flayer;
extern struct display *display, *displays;
#!/usr/bin/perl
use strict;
use warnings;
use JSON::Syck;
use Data::Dumper;
my $a = { hoge => 'fuga' };
my $b = { foo => $a, bar => $a };
warn Dumper $b;
@dealforest
dealforest / gist:1004361
Created June 2, 2011 12:49
node.js websocket server
var sys = require('sys');
var ws = require('websocket-server');
var host = 'localhost';
var port = 10000;
var webSocket = ws.createServer();
webSocket.addListener("connection", function (connection) {
sys.puts("connect: " + connection._req.socket.remoteAddress);
connection.addListener("message", function (message) {
@dealforest
dealforest / AES256Cipher.java
Created March 1, 2012 13:39
AES256 encryption on Android
package net.dealforest.sample.crypt;
import javax.crypto.BadPaddingException;
import javax.crypto.Cipher;
import javax.crypto.IllegalBlockSizeException;
import javax.crypto.NoSuchPaddingException;
import javax.crypto.spec.IvParameterSpec;
import javax.crypto.spec.SecretKeySpec;
import java.security.InvalidKeyException;
@dealforest
dealforest / appmodelsconstants.rb
Created October 22, 2012 20:16
about settingslogin on Rails
class Constants < Settingslogic
source "#{Rails.root}/config/constants.yml"
namespace Rails.env
end
@dealforest
dealforest / gist:3987175
Created October 31, 2012 14:00
ActiveRecord exexute sample
/* データ
> select * from hoge;
+------+------+
| fuga | foo |
+------+------+
| 1 | 2 |
| 3 | 4 |
| 5 | 6 |
+------+------+
*/
define pv
if $argc == 0
po [[[UIApplication sharedApplication] keyWindow] recursiveDescription]
end
if $argc == 1
po [$arg0 recursiveDescription]
end
end
define st
# GDB
(gdb) info malloc-history <address>
(gdb) shell malloc_history <pid> <address>
# LLDB
(lldb) command script import lldb.macosx.heap
(lldb) malloc_info --stack-history <address>
@dealforest
dealforest / post-checkout
Last active October 10, 2018 15:10
When you switch branch, run the `pod install`. install to `path/to/.git/hooks/`
#!/bin/sh
set -e
prev="$1"
new="$2"
branch_switch="$3"
if [ -z "$branch_switch" ] || [ $branch_switch -eq 0 ]; then
exit 0 # this was a file checkout