Skip to content

Instantly share code, notes, and snippets.

View taskie's full-sized avatar
๐ŸŒ
๐‘ฉ๐‘ณ๐‘จ๐’๐‘ฐ๐‘ต๐‘ฎ ๐‘ญ๐‘จ๐‘บ๐‘ป

taskie taskie

๐ŸŒ
๐‘ฉ๐‘ณ๐‘จ๐’๐‘ฐ๐‘ต๐‘ฎ ๐‘ญ๐‘จ๐‘บ๐‘ป
View GitHub Profile
@taskie
taskie / range.js
Created May 24, 2015 02:39
generator "range" like Python 3
function * range(n, end, step = 1) {
if (typeof end === "undefined") {
end = n;
n = 0;
}
if (step === 0) {
throw Error("step must not be zero")
}
if (end > n && step > 0) {
for (let i = n; i < end; i += step) yield i;
@taskie
taskie / n4317.cc
Last active August 29, 2015 14:19
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4317.pdf
#include <iterator>
namespace n4317
{
namespace internal
{
template <typename RanIter, typename Dist>
void advance_helper(RanIter & i, RanIter e, Dist n, std::random_access_iterator_tag)
#!/usr/bin/env ruby
(inpath, outpath, org, dst = $*)
unless inpath && outpath && org && dst
puts "usage: conv_exs infile outfile org dst"
exit 1
end
binstr = nil
#!/usr/bin/env ruby
Dir.chdir($*[0]) if $*[0]
open("Encoding Errors.txt") do |f|
f.each do |line|
org, new = line.split("->").map{|x| x.strip}
if new && new != "New File Name"
`mv "#{new}" "#{org}"`
end