Skip to content

Instantly share code, notes, and snippets.

View ioslocaleidentifiers.csv
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
mr Marathi
bs Bosnian
ee_TG Ewe (Togo)
ms Malay
kam_KE Kamba (Kenya)
mt Maltese
ha Hausa
es_HN Spanish (Honduras)
ml_IN Malayalam (India)
ro_MD Romanian (Moldova)
@candyan
candyan / highsierra_bootable.sh
Created Aug 8, 2018 — forked from agentsim/highsierra_bootable.sh
Create bootable ISO from HighSierra Installer
View highsierra_bootable.sh
# Generate a BaseSystem.dmg with 10.13 Install Packages
hdiutil attach /Applications/Install\ macOS\ 10.13\ Beta.app/Contents/SharedSupport/InstallESD.dmg -noverify -mountpoint /Volumes/highsierra
hdiutil create -o /tmp/HighSierraBase.cdr -size 7316m -layout SPUD -fs HFS+J
hdiutil attach /tmp/HighSierraBase.cdr.dmg -noverify -mountpoint /Volumes/install_build
asr restore -source /Applications/Install\ macOS\ 10.13\ Beta.app/Contents/SharedSupport/BaseSystem.dmg -target /Volumes/install_build -noprompt -noverify -erase
cp -R /Volumes/highsierra/Packages /Volumes/OS\ X\ Base\ System/System/Installation
hdiutil detach /Volumes/OS\ X\ Base\ System/
hdiutil detach /Volumes/highsierra/
mv /tmp/HighSierraBase.cdr.dmg /tmp/BaseSystem.dmg
@candyan
candyan / create-iso.sh
Created Aug 8, 2018 — forked from julianxhokaxhiu/create-iso.sh
Simple bash script to create a Bootable ISO from macOS Sierra Install Image from Mac App Store
View create-iso.sh
#!/bin/bash
#
# Credits to fuckbecauseican5 from https://www.reddit.com/r/hackintosh/comments/4s561a/macos_sierra_16a238m_install_success_and_guide/
# Adapted to work with the official image available into Mac App Store
#
# Enjoy!
hdiutil attach /Applications/Install\ macOS\ Sierra.app/Contents/SharedSupport/InstallESD.dmg -noverify -nobrowse -mountpoint /Volumes/install_app
hdiutil create -o /tmp/Sierra.cdr -size 7316m -layout SPUD -fs HFS+J
hdiutil attach /tmp/Sierra.cdr.dmg -noverify -nobrowse -mountpoint /Volumes/install_build
View bootstrap.sh
#/bin/sh
yum install git -y
yum install vim -y
yum install wget -y
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
python get-pip.py
git clone https://github.com/candyan/shadowsocks-py-mu.git -b berrylab
pip install supervisor
mkdir -p /var/log/supervisor/
@candyan
candyan / latest-ffmpeg-centos6.sh
Last active Sep 1, 2017 — forked from mustafaturan/latest-ffmpeg-centos6.sh
Installs latest ffmpeg on Centos 6
View latest-ffmpeg-centos6.sh
# source: https://trac.ffmpeg.org/wiki/CentosCompilationGuide
yum install autoconf automake gcc gcc-c++ git libtool make nasm pkgconfig zlib-devel
mkdir ~/ffmpeg_sources
cd ~/ffmpeg_sources
curl -L -O http://www.tortall.net/projects/yasm/releases/yasm-1.2.0.tar.gz
tar xzvf yasm-1.2.0.tar.gz
cd yasm-1.2.0
View spider.py
# coding=utf8
import requests
class HDCourse:
def __init__(self, id, title, teacher_name, videos):
self.id = id
self.title = title
View gist:bfd537fa549510ab411ed08c28192fc8
ffmpeg -i $video_file -vn -ar 16000 -ac 1 -acodec pcm_s16le -ss 00:01:00 -t 00:00:30 $audio.wav
-vn 排除视频 (-an 排除音频 / -sn 排除字幕)
-ar 采样率
-ac 声道数量
-acodec 编码 ( flac / pcm_s16le(16bit 线性PCM) )
-ss 开始时间点
-t 时长
@candyan
candyan / gist:a048abe577ec7c351a10351209b4f634
Last active Oct 10, 2016
zepto.js swipeUp & swipeDown not working on mobile device
View gist:a048abe577ec7c351a10351209b4f634
add the listener to disable browser scroll.
```document.addEventListener('touchmove', function (event) {
event.preventDefault();
}, false);
```
@candyan
candyan / gist:054960b2100dd192b0b89e61031e4c46
Created Sep 5, 2016
Error: FBSDKInternalUtility viewControllerforView No know class method
View gist:054960b2100dd192b0b89e61031e4c46
tips: use viewControllerForView instead of viewControllerforView
@candyan
candyan / gist:363ea4dbdcbceba28869
Last active Jan 21, 2016
iPhone & Android 通用的最佳全屏尺寸
View gist:363ea4dbdcbceba28869
1152 * 1920 (这个结论是通过统计和计算得出的)