Skip to content

Instantly share code, notes, and snippets.

{{#each publications as |publication|}}
<h1>Hello, {{publication.name}}</h1>
{{else}}
No publications
{{/each}}
0x1E65F71b024937b988fdba09814d60049e0Fc59d
@courajs
courajs / chatServer.js
Created September 8, 2017 17:48 — forked from creationix/chatServer.js
A simple TCP based chat server written in node.js
// Load the TCP Library
net = require('net');
// Keep track of the chat clients
var clients = [];
// Start a TCP Server
net.createServer(function (socket) {
// Identify this client

Keybase proof

I hereby claim:

  • I am courajs on github.
  • I am courajs (https://keybase.io/courajs) on keybase.
  • I have a public key ASDQM2f55XEJuta3q5dKF9ZHHjBEu2H4M0MKPvNrCiF8_go

To claim this, I am signing this object:

@courajs
courajs / click.c
Created April 6, 2022 21:57 — forked from rsp/click.c
// Compile instructions:
//
// gcc -o click click.c -Wall -framework ApplicationServices
#include <ApplicationServices/ApplicationServices.h>
#include <unistd.h>
int main(int argc, char *argv[]) {
int x = 0, y = 0, n = 1;
float duration = 0.1;
@courajs
courajs / on_suspend.sh
Last active October 6, 2022 18:21
Run a command each time you suspend vim with ctrl+z
# Current unix time in millisecond
function ms() {
echo $(($(date +%s%N)/1000000))
}
# If we suspend vim (ctrl-z), run the on-suspend command and then
# re-foreground vim. If we exit fully, return to the shell.
function post_vim() {
# 148 status code indicate the previous command was suspended
if [ ! $? = 148 ]; then return; fi