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"?> | |
<!-- Copyright (C) 2007 The Android Open Source Project | |
Licensed under the Apache License, Version 2.0 (the "License"); | |
you may not use this file except in compliance with the License. | |
You may obtain a copy of the License at | |
http://www.apache.org/licenses/LICENSE-2.0 | |
Unless required by applicable law or agreed to in writing, software |
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
(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)) |
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
#!/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 |
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
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: |
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
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) | |
} | |
} |
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
#!/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" |
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
#!/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" |
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
#!/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" |
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
$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 . |
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
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 |
OlderNewer