Skip to content

Instantly share code, notes, and snippets.

@xd547
xd547 / .vimrc
Created April 8, 2019 01:42
.vimrc whith powerline
set background=dark
colors solarized
let g:airline_theme='solarized'
let g:airline_powerline_fonts = 1
let g:airline_left_sep = ''
let g:airline_left_alt_sep = ''
let g:airline_right_sep = ''
let g:airline_right_alt_sep = ''
let g:airline_symbols.branch = ''
@xd547
xd547 / .vimrc
Created April 8, 2019 01:38
.vimrc
" encoding
set encoding=utf-8
set fileencoding=utf-8
" preference
syntax on
set ai
set shiftwidth=2
set tabstop=2
set softtabstop=2
@xd547
xd547 / temp.sh
Created November 6, 2018 17:08
Get Raspberry Pi temperature
#!/bin/sh
GetCPUTemp() {
value=`cat /sys/class/thermal/thermal_zone0/temp | tr -d '\n'`
cpu_temp=`awk "BEGIN {print $value/1000.0}"`
echo "$cpu_temp"
}
GetGPUTemp() {
gpu_temp=`vcgencmd measure_temp |sed -e "s/temp=//g" | sed -e "s/'C//g"`
@xd547
xd547 / delete_time_machine_localsnapshot.sh
Last active November 27, 2018 11:22
Delete all localsnapshots expect last one.
#!/bin/sh
echo 'Delete all local snapshots expect last one.'
for date in $(tmutil listlocalsnapshots / | cut -d. -f4 | sed '$d')
do
tmutil deletelocalsnapshots $date
done
echo 'Thinlocalsnapshots'
tmutil thinlocalsnapshots /
# https://github.com/gpakosz/.tmux
# (‑●‑●)> dual licensed under the WTFPL v2 license and the MIT license,
# without any warranty.
# Copyright 2012— Gregory Pakosz (@gpakosz).
# -- navigation ----------------------------------------------------------------
# if you're running tmux within iTerm2
# - and tmux is 1.9 or 1.9a
@xd547
xd547 / downloads.js
Created November 11, 2016 06:43 — forked from anonymous/downloads.js
ASUS DownloadMaster batch downloads
// 1. open DownloadMaster in chrome
// 2. use the code in chrome console
urls = ["", ""] //urls array
addDownload = function(url) {
showPanel();
document.getElementById("HTTP_usb_dm_url").value = url;
dm_add_status();
}
@xd547
xd547 / hot.py
Created November 15, 2014 08:12
from multiprocessing import Pool
def loop(x):
while True:
pass
Pool().map(loop, range(100))
@xd547
xd547 / index.js
Created August 21, 2014 08:59 — forked from edokeh/index.js
//
// _oo0oo_
// o8888888o
// 88" . "88
// (| -_- |)
// 0\ = /0
// ___/`---'\___
// .' \\| |// '.
// / \\||| : |||// \
// / _||||| -:- |||||- \
using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
using System.Diagnostics;
namespace sort
{
class Program
#define MYLog( s, ... ) NSLog( @"\n<%p %@:(%d)>\n@@@ %@", self, [[NSString stringWithUTF8String:__FILE__] lastPathComponent], __LINE__, [NSString stringWithFormat:(s), ##__VA_ARGS__] )