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
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" | |
" 一般设定 | |
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" | |
" 设定主题 | |
colo evening | |
" 设定默认解码 | |
set fenc=utf-8 | |
set fencs=utf-8,usc-bom,euc-jp,gb18030,gbk,gb2312,cp936 |
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 | |
# Warning! | |
# if you DIY a stage package like this, | |
# you must use the Stage3`s /etc/udev/* | |
# or rm /etc/udev/rules.d/70* | |
# Warning! | |
# last edited by likuku on 2012.03.29 | |
DATE=`date +%Y_%m_%d_%H_%M_%S` | |
ARCH=`uname -m` |
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
# Using this script downloads ALL the videos in NSScreencast. | |
# Use it wisely, it's extra load/bandwidth for the NSScreencast website. | |
# Usage: `EMAIL=your email PASSWORD=your password END=how many videos should be downloaded? ruby download-nsscreencast.rb` | |
require "mechanize" | |
require "parallel" | |
mechanize = Mechanize.new | |
mechanize.post("https://www.nsscreencast.com/user_sessions", {"email" => ENV["EMAIL"], "password" => ENV["PASSWORD"]}) | |
mechanize.pluggable_parser.default = Mechanize::Download |
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
static func getPrimes(to n: Int) -> [Int] { | |
let xmody = (1...n) | |
.map { x in (1...n).map { y in x % y } } | |
let primes = xmody | |
.map { mods in | |
mods.enumerate() | |
.filter { y, mod in mod == 0 } | |
.map { y, mod in y + 1 } // divisors for x | |
} |