start new:
tmux
start new with session name:
tmux new -s myname
template <typename InputIt1, typename InputIt2, typename BinaryFunction> | |
auto map_with_index(InputIt1 first, InputIt2 last, BinaryFunction f) -> vector<typename iterator_traits<InputIt1>::value_type> | |
{ | |
vector<typename iterator_traits<InputIt1>::value_type> result(distance(first, last)); | |
size_t i = 0; | |
generate(begin(result), end(result), [&](){ | |
return f(*first++, i++); | |
}); |
#define flag1 1<<0 | |
#define flag2 1<<1 | |
#define flag3 1<<2 | |
#define flag4 1<<3 | |
long arg1 = flag1|flag2; | |
long arg2 = flag1|flag4; | |
printf("%i %i %i %i \n", flag1, flag2, flag3, flag4); | |
# Considering an JSON object like this one: | |
# | |
# { | |
# "store": { | |
# "foo": { | |
# "value":"bar" | |
# } | |
# }, | |
# "anotherstore": { | |
# "wat":{ |
def output name=((default=true); "caius") | |
puts "name: #{name.inspect}" | |
puts "default: #{default.inspect}" | |
end | |
output | |
# >> name: "caius" | |
# >> default: true | |
output "avdi" |
# These are my notes from the PragProg book on CoffeeScript of things that either | |
# aren't in the main CS language reference or I didn't pick them up there. I wrote | |
# them down before I forgot, and put it here for others but mainly as a reference for | |
# myself. | |
# assign arguments in constructor to properties of the same name: | |
class Thingie | |
constructor: (@name, @url) -> | |
# is the same as: |
### | |
Module dependencies | |
### | |
require.paths.unshift "#{__dirname}/lib/support/express-csrf/" | |
require.paths.unshift "#{__dirname}/lib/support/node_hash/lib/" | |
express = require 'express' | |
app = module.exports = express.createServer() | |
RedisStore = require 'connect-redis' |