Skip to content

Instantly share code, notes, and snippets.

View icyleaf's full-sized avatar
🍺
Diving into beer

icyleaf icyleaf

🍺
Diving into beer
View GitHub Profile
@icyleaf
icyleaf / img2vbox.sh
Last active February 8, 2020 06:50
Convert img file to vbox format
#!/usr/bin/env bash
#
# icyleaf
# 2020-02-03
#
VM_NAME=$1
IMG_FILE=$2
IMG_PATH=`dirname $IMG_FILE`
IMG_NAME=`basename $IMG_FILE`
#include <netdb.h>
#include <ifaddrs.h>
#include <arpa/inet.h>
+ (NSArray *)loopUpIPAddress:(NSURL *)url {
NSMutableArray *ipAddrs = [[NSMutableArray alloc] init];
char **pptr;
struct hostent *_host = gethostbyname([[url host] UTF8String]);
pptr = _host->h_addr_list;
@icyleaf
icyleaf / README.md
Created January 9, 2018 07:19
Base16 Eighties Dark for Xcode (Font size changed to 14)

Base16 Eighties Dark for Xcode (Font size changed to 14)

image = MiniMagick::Image.open('source.jpg')
image.colorspace 'gray'
pixels = image.get_pixels
0.upto(image.height - 1) do |y|
image.combine_options do |c|
0.upto(image.width - 1) do |x|
color = pixels[y][x][0]
@icyleaf
icyleaf / README.md
Last active April 25, 2017 02:33
initd-template-for-rails

Initd template for rails with sidekiq

@icyleaf
icyleaf / .tmux.conf
Last active April 18, 2017 10:30
my tmux config file
# tmux source-file ~/.tmux.conf
# author: icyleaf <icyleaf.cn@gmail.com>
# Golbal
## using the default prefix hotkey
set -g prefix C-a
## Options
set -g base-index 1
@icyleaf
icyleaf / AndroidManifest.xml
Last active December 20, 2016 07:03
Android package based UMeng analytics
<?xml version="1.0" encoding="utf-8"?>
<manifest ...>
<application ...>
<activity ...>
<meta-data android:name="UMENG_APPKEY" android:value="UMENG-API-KEY" />
<meta-data android:name="UMENG_CHANNEL" android:value="Development" />
</application>
<uses-permission android:name="android.permission.INTERNET" />
@icyleaf
icyleaf / load_tar_to_docker.sh
Last active August 1, 2016 07:26
Save all docker images to disk & Load archive file to docker.
for file in $(ls *.tar); do
echo "load $file"
docker load -i $file
done

icyleaf's atom settings, automatic update by sync-settings

@icyleaf
icyleaf / tmux-cheatsheet.markdown
Created May 26, 2016 04:12 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname