This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# | |
# icyleaf | |
# 2020-02-03 | |
# | |
VM_NAME=$1 | |
IMG_FILE=$2 | |
IMG_PATH=`dirname $IMG_FILE` | |
IMG_NAME=`basename $IMG_FILE` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for file in $(ls *.tar); do | |
echo "load $file" | |
docker load -i $file | |
done |
icyleaf's atom settings, automatic update by sync-settings