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
THE PROBLEM: | |
Standard practices say no non-root process gets to talk to the Internet on a port less than 1024. How, then, could I get Node talking on port 80 on EC2? (I wanted it to go as fast as possible and use the smallest possible share of my teeny tiny little micro-instance's resources, so proxying through nginx or Apache seemed suboptimal.) | |
THE TEMPTINGLY EASY BUT TOTALLY WRONG SOLUTION: | |
Alter the port the script talks to from 8000 to 80: | |
}).listen(80); |
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
// alex@rozgo.com | |
using UnityEngine; | |
using System.Collections; | |
public class Gestures : MonoBehaviour { | |
float lastf0f1Dist; | |
void Update () { |
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
for a modelview matrix is: | |
m0 m4 m8 m12 | |
m1 m5 m9 m13 | |
m2 m6 m10 m14 | |
m3 m7 m11 m15 | |
then: | |
(m0,m1,m2): X-Model in View coord. |
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
# increase TCP max buffer size settable using setsockopt() | |
net.core.rmem_max=16777216 | |
net.core.wmem_max=16777216 | |
# increase Linux autotuning TCP buffer limit | |
net.ipv4.tcp_rmem=4096 87380 16777216 | |
net.ipv4.tcp_wmem=4096 65536 16777216 | |
# increase the length of the processor input queue | |
net.core.netdev_max_backlog=30000 |
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 UnityEngine; | |
using System.Collections; | |
using System.IO; | |
public class ExecuteCommand : MonoBehaviour | |
{ | |
void Start () | |
{ | |
//string path = Directory.GetCurrentDirectory(); |
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
given this: | |
$ git status | |
# On branch muzzle_flash | |
# Changes not staged for commit: | |
# (use "git add <file>..." to update what will be committed) | |
# (use "git checkout -- <file>..." to discard changes in working directory) | |
# | |
# modified: Assets/Ammo/CannonBall.prefab |
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
#include <SDKDDKVer.h> | |
#include <Windows.h> | |
#pragma warning(disable:4819) | |
#pragma warning(disable:4996) | |
// for OpenCV2 | |
#include "opencv2/imgproc/imgproc.hpp" | |
#include "opencv2/objdetect/objdetect.hpp" | |
#include "opencv2/gpu/gpu.hpp" |
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
#include <websocketpp/config/asio.hpp> | |
#include <websocketpp/server.hpp> | |
#include <iostream> | |
#include <websocketpp/common/thread.hpp> | |
#include <boost/algorithm/string.hpp> | |
#include <boost/algorithm/string/classification.hpp> | |
typedef websocketpp::server<websocketpp::config::asio> server; | |
using websocketpp::connection_hdl; |
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
module Bowel.Bow | |
module Player = | |
type UserId = UserId of string | |
type UserName = UserName of string | |
type Player = | |
{ | |
UserId : UserId |
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
// Creating new threads | |
open System | |
open System.Threading | |
//What will execute on each thread | |
let threadBody() = | |
for i in 1..5 do | |
//Wait 1/10 of a second | |
Thread.Sleep(100) | |
printfn "[Thread %d] %d ..." |
OlderNewer