Skip to content

Instantly share code, notes, and snippets.

@CrowdHailer
CrowdHailer / actor.js
Last active March 23, 2021 10:43
Implementing actors in JavaScript.
// Turns out this was not too difficult.
// By using the event loop as a global mail box ordering is even guaranteed for messages between only two actors.
// TODO would like to try and put one actor in a web worker to get some real parallism
// TODO would like to handle errors and have the concept of a deceased actor while a reference to an actor still exists. Probably involves creating an actor system like in Scala. Eurgh.
var actor = {
send: function(message) {
var self = this;
console.log("sending to:", self);
setTimeout(function(){
@alanpeabody
alanpeabody / my_app.ex
Last active March 24, 2024 13:28
Websockets in Elixir with Cowboy and Plug
defmodule MyApp do
use Application
def start(_type, _args) do
import Supervisor.Spec, warn: false
children = [
Plug.Adapters.Cowboy.child_spec(:http, MyApp.Router, [], [
dispatch: dispatch
])
@bradmontgomery
bradmontgomery / install-comodo-ssl-cert-for-nginx.rst
Last active April 1, 2024 11:21
Steps to install a Comodo PositiveSSL certificate with Nginx.

Setting up a SSL Cert from Comodo

I use Namecheap.com as a registrar, and they resale SSL Certs from a number of other companies, including Comodo.

These are the steps I went through to set up an SSL cert.

Purchase the cert

@BaseCase
BaseCase / gist:2139106
Created March 20, 2012 18:17
A sample Cakefile
{exec} = require 'child_process'
task 'test', 'Runs all Jasmine specs in spec/ folder', ->
test()
task 'compile', 'Compiles coffee in src/ to js in bin/', ->
compile()
task 'stitch', 'Stitches all app .js files', ->
@Takazudo
Takazudo / Cakefile
Created February 17, 2012 18:14
Cakefile to concatenate, minify coffee
# ==================================================================
# Cakefile - compile, concatenate, minify coffee
# ==================================================================
# ├─ Cakefile
# ├─ lib
# │   ├─ all.js
# │   └─ all.min.js
# └─ src
# ├─ fuga.coffee
# └─ hoge.coffee
@coolaj86
coolaj86 / how-to-publish-to-npm.md
Last active April 2, 2024 20:18
How to publish packages to NPM

Getting Started with NPM (as a developer)

As easy as 1, 2, 3!

Updated:

  • Aug, 08, 2022 update config docs for npm 8+
  • Jul 27, 2021 add private scopes
  • Jul 22, 2021 add dist tags
  • Jun 20, 2021 update for --access=public
  • Sep 07, 2020 update docs for npm version