Skip to content

Instantly share code, notes, and snippets.

View king6cong's full-sized avatar

wangcong king6cong

View GitHub Profile
(load "~/repos/toutiao_config/package_list.el")
(if (>= emacs-major-version 24)
(progn
(package-initialize)
(package-refresh-contents)
(when (not (require 'magit nil t))
(package-install 'magit))
(when (not (require 'go-mode nil t))
(package-install 'go-mode))
#!/bin/bash
# Build latest version of Emacs, version management with stow
# OS: Ubuntu 14.04 LTS
# version: 24.5
# Toolkit: lucid
# Warning, use updated version of this script in: https://github.com/favadi/build-emacs
set -e
import hashlib
def hash_passwd(passwd, salt):
return 'sha256$' + hashlib.sha256(passwd + salt).hexdigest()
SALT = "this is a secret and do not share with others"
# use case:
fn test_closure_recursive() {
struct Fact<'s> {
f: &'s Fn(&Fact, u32) -> u32,
}
impl<'s> Fact<'s> {
pub fn call(&self, i: u32) -> u32 {
(self.f)(&self, i)
}
}
#!/bin/sh
set -u
LOG_DIR=/tmp/lark_log
mkdir -p $LOG_DIR
log_path=`ps aux|grep crash|grep -i lark|grep -v grep|sed "s/.*metrics-dir=\([^-]*\).*/\1/"`
log_path="$(sed -e 's/[[:space:]]*$//' <<<${log_path})"
echo '>>> log path:' $log_path
cd "$log_path"
#!/bin/sh
set -u
LOG_DIR=/tmp/lark_log
mkdir -p $LOG_DIR
dump_path=`ps aux|grep crash|grep -i lark|grep -v grep|sed "s/.*metrics-dir=\([^-]*\).*/\1/"`
dump_path="$(sed -e 's/[[:space:]]*$//' <<<${dump_path})"
echo '>>> dump path:' $dump_path
cd "$dump_path"
#!/bin/sh
set -u
LOG_DIR=/tmp/lark_log
mkdir -p $LOG_DIR
dump_path=`ps aux|grep crash|grep -i lark|grep -v grep|sed "s/.*metrics-dir=\([^-]*\).*/\1/"`
dump_path="$(sed -e 's/[[:space:]]*$//' <<<${dump_path})"
echo '>>> dump path:' $dump_path
cd "$dump_path"
$crash_path="$home\AppData\Local\Temp\Lark Crashes"
$zip_path="$env:temp\lark"
Write-Host "crash_path: $crash_path, zip_path: $zip_path" -foreground Green
New-Item -Force -Path "$zip_path" -ItemType Directory
Set-Location "$zip_path"
Compress-Archive -Force -Path "$crash_path" -DestinationPath dump.zip
Write-Host "completed. Please upload dump.zip for inspection" -foreground Green
explorer.exe .
rm -rf ~/Library/Developer/Xcode/DerivedData/*
rm -rf ~/Library/Developer/Xcode/Archives/*
rm -rf ~/Library/Caches/Homebrew/*.gz
rm -rf ~/Library/Caches/Homebrew/*.zip
rm -rf ~/Library/Caches/Homebrew/Cask/*
rm -rf ~/Library/Logs/*
rm -rf '~/Music/iTunes/iTunes Media/Downloads'
rm -rf '~/Music/iTunes/iTunes Media/Mobile Applications'
ls '~/Library/Developer/Xcode/iOS DeviceSupport'
brew cleanup