Some exercises from the Falsy Values workshops.
The good parts:
- HTTP server and client in same script
- Express cookies example
- Express routing example
- Express error handling
- Express middlewares example
- Simple HTTP proxy
var AWS = require('aws-sdk'); | |
AWS.config.update({ | |
accessKeyId: '{AWS_KEY}', | |
secretAccessKey: '{AWS_SECRET}', | |
region: '{SNS_REGION}' | |
}); | |
var sns = new AWS.SNS(); |
Some exercises from the Falsy Values workshops.
The good parts:
defmodule MyApp.CLI do | |
def main(_args) do | |
IO.puts("Hello from MyApp!") | |
end | |
end |
A running example of the code from:
Small refactorings made to original code:
var apn = require("apn") | |
var apnError = function(err){ | |
console.log("APN Error:", err); | |
} | |
var options = { | |
"cert": "cert.pem", | |
"key": "key.pem", | |
"passphrase": null, |
I [tweeted this already][1] but I thought it could use some expansion:
Enable decentralized git workflow: git config alias.serve "daemon --verbose --export-all --base-path=.git --reuseaddr --strict-paths .git/"
Say you use a git workflow that involves working with a core "official" repository that you pull and push your changes from and into. I'm sure many companies do this, as do many users of git hosting services like Github.
Say that server, or Github, goes down for a bit.
// simple fragment shader | |
// 'time' contains seconds since the program was linked. | |
uniform float time; | |
uniform sampler2D tex; | |
uniform sampler2D tex2; | |
float radius = .5; |
/** | |
* encode to handle invalid UTF | |
* | |
* If Chrome tells you "Could not decode a text frame as UTF-8" when you try sending | |
* data from nodejs, try using these functions to encode/decode your JSON objects. | |
* | |
* see discussion here: http://code.google.com/p/v8/issues/detail?id=761#c8 | |
* see also, for browsers that don't have native JSON: https://github.com/douglascrockford/JSON-js | |
* | |
* Any time you need to send data between client and server (or vice versa), encode before sending, |
#include <roxlu/core/Log.h> | |
#include <roxlu/core/Utils.h> | |
#include <video/X264Encoder.h> | |
X264Encoder::X264Encoder() | |
:in_width(0) | |
,in_height(0) | |
,in_pixel_format(AV_PIX_FMT_NONE) | |
,out_width(0) | |
,out_height(0) |
#include <cmath> | |
#include <assert.h> | |
#include <core/TestPattern.h> | |
TestPattern::TestPattern() | |
:w(0) | |
,h(0) | |
,frame_num(0) | |
,duration(0) |