Skip to content

Instantly share code, notes, and snippets.

Avatar

RainySummer xd547

View GitHub Profile
@xd547
xd547 / .vimrc
Created Apr 8, 2019
.vimrc whith powerline
View .vimrc
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 = ''
View .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 Nov 6, 2018
Get Raspberry Pi temperature
View temp.sh
#!/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 Nov 27, 2018
Delete all localsnapshots expect last one.
View delete_time_machine_localsnapshot.sh
#!/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 /
View .tmux.conf.local
# 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 Nov 11, 2016 — forked from anonymous/downloads.js
ASUS DownloadMaster batch downloads
View downloads.js
// 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();
}
View hot.py
from multiprocessing import Pool
def loop(x):
while True:
pass
Pool().map(loop, range(100))
View index.js
//
// _oo0oo_
// o8888888o
// 88" . "88
// (| -_- |)
// 0\ = /0
// ___/`---'\___
// .' \\| |// '.
// / \\||| : |||// \
// / _||||| -:- |||||- \
View sorting
using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
using System.Diagnostics;
namespace sort
{
class Program
View better_logging
#define MYLog( s, ... ) NSLog( @"\n<%p %@:(%d)>\n@@@ %@", self, [[NSString stringWithUTF8String:__FILE__] lastPathComponent], __LINE__, [NSString stringWithFormat:(s), ##__VA_ARGS__] )
You can’t perform that action at this time.