Skip to content

Instantly share code, notes, and snippets.

View zchee's full-sized avatar
😩
want to Go knowledge...

Koichi Shiraishi zchee

😩
want to Go knowledge...
View GitHub Profile
@YukiSakamoto
YukiSakamoto / random.c
Created September 24, 2012 14:22
Disable ASLR on MacOSX
#include <stdio.h>
/*
This source is testing for address layout randomization.
If ASLR is enabled, output of this program will be variable.
*/
int main(void)
{
printf("%p\n", main);
@yonchu
yonchu / chpwd_for_zsh.sh
Created October 23, 2012 00:41
zshにてcd後に自動的にlsを行うchpwd関数。ファイル数が多い場合は省略表示します。(.zshrcに設定して使用します)
chpwd() {
ls_abbrev
}
ls_abbrev() {
# -a : Do not ignore entries starting with ..
# -C : Force multi-column output.
# -F : Append indicator (one of */=>@|) to entries.
local cmd_ls='ls'
local -a opt_ls
opt_ls=('-aCF' '--color=always')
@paulfryzel
paulfryzel / gist:3947535
Created October 24, 2012 17:36
like gofmt but for c... and using astyle
#!/usr/bin/env bash
# mostly from http://word.bitly.com/post/31921713978/static-analysis
function cfmt {
if [[ $# -ne 1 ]]; then
echo "Usage: cfmt <file>"
else
astyle \
--style=1tbs \
--lineend=linux \
--convert-tabs \
@nikuuchi
nikuuchi / dict.rb
Created November 2, 2012 07:48
辞書引くためにブラウザ使うのが面倒だったから。
#!/usr/bin/env ruby
require 'open-uri'
require 'nokogiri'
dict = Nokogiri::HTML(open("http://ejje.weblio.jp/content/#{ARGV[0].downcase}")).search("div.Kejje")
dict.search("script").remove
dict.search("div.level0").each{|node| puts node.text.delete("\r")}
@vidrowan
vidrowan / vm-management.sh
Created November 16, 2012 21:20 — forked from jhuebsch/vm-management.sh
Control parallels VM via command line and mount remote users home dir as network share with sshfs
#!/bin/sh
# Parallels VM management
# start/pause/resume Parallels VM. When starting VM mounts VM users home dir (default) as
# network share on local machine using fuse4x and sshfs. When pausing VM, unmounts network
# share before pausing VM.
vmsb() { #Usage: vmsb <command:string [start|resume|pause|stop]>
#### Colors ####
txtrst='\\033[0m' # Text Reset
txtred='\\033[0\;31m' # Red
@0xjjpa
0xjjpa / chrome.md
Created December 9, 2012 04:37
Understanding Google Chrome Extensions

#Introduction

Developing Chrome Extensions is REALLY fun if you are a Front End engineer. If you, however, struggle with visualizing the architecture of an application, then developing a Chrome Extension is going to bite your butt multiple times due the amount of excessive components the extension works with. Here are some pointers in how to start, what problems I encounter and how to avoid them.

Note: I'm not covering chrome package apps, which although similar, work in a different way. I also won't cover the page options api neither the new brand event pages. What I explain covers most basic chrome applications and should be enough to get you started.

Table of Contents

  1. Understand the Chrome Architecture
  2. Understand the Tabs-Extension Relationship
  3. Picking the right interface for the job
@maepon
maepon / gist:4264568
Created December 12, 2012 03:13
Emmet + hayaku プラグインのショートコードをしらみつぶし(2文字まで)
*{
/*a*/
-webkit-animation: ;
-moz-animation: ;
-ms-animation: ;
-o-animation: ;
animation: ;
/*b*/
bottom: 100%;
/*c*/
@P7h
P7h / IntelliJ_IDEA__Perf_Tuning.txt
Last active October 16, 2025 02:52
Performance tuning parameters for IntelliJ IDEA. Add these params in idea64.exe.vmoptions or idea.exe.vmoptions file in IntelliJ IDEA. If you are using JDK 8.x, please knock off PermSize and MaxPermSize parameters from the tuning configuration.
-server
-Xms2048m
-Xmx2048m
-XX:NewSize=512m
-XX:MaxNewSize=512m
-XX:PermSize=512m
-XX:MaxPermSize=512m
-XX:+UseParNewGC
-XX:ParallelGCThreads=4
-XX:MaxTenuringThreshold=1
@takashi
takashi / sublime-keymap
Created January 16, 2013 12:42
sublime-keybinding
[
// how to move in the filer with hjkl
{ "keys": ["j"], "command": "move", "args": {"by": "lines", "forward": true}, "context":
[ {"key": "control", "operand": "sidebar_tree"} ]
},
{ "keys": ["k"], "command": "move", "args": {"by": "lines", "forward": false}, "context":
[ {"key": "control", "operand": "sidebar_tree"} ]
},
{ "keys": ["l"], "command": "move", "args": {"by": "characters", "forward": true}, "context":
[ {"key": "control", "operand": "sidebar_tree"} ]
@bells17
bells17 / my_sublime_text_2_preferences.json
Last active August 25, 2016 05:09
個人用に作成したSublime Text 2 の設定ファイルです。
{
/*
* UI関係
*/
// カラー&スキーマ
"color_scheme": "Packages/Color Scheme - Default/Monokai.tmTheme", // カラー
"theme": "Soda Dark.sublime-theme", // スキーマ
// カーソルのスタイル ("smooth", "phase", "blink", "wide", "solid")
"caret_style": "smooth",