var http = require('http');
var server = http.createServer(function (request, response) {
This file contains hidden or 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
| # Install JUST from https://just.systems | |
| # Put this `arch-justfile` into target folder and rename it to `justfile` | |
| # Then Run `just -l` to see the full list of Recipes. | |
| # Install necessary toolings | |
| setup: | |
| #!/usr/bin/env sh | |
| # Check if Brew is available otherwise install it | |
| if ! command -v brew &> /dev/null; then | |
| /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"; |
This file contains hidden or 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
| { | |
| "id": "a98ee9d2-12e1-e302-1c0d-da0a7403e746", | |
| "name": "Mae Pay Soh API", | |
| "description": "", | |
| "order": [ | |
| "874eaf47-dfbb-7492-4049-b570a7cfe6dc" | |
| ], | |
| "folders": [ | |
| { | |
| "id": "59743053-8e46-535f-f3f6-2ea3df28e004", |
This file contains hidden or 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
| # Simple bijective function | |
| # Basically encodes any integer into a base(n) string, | |
| # where n is ALPHABET.length. | |
| # Based on pseudocode from http://stackoverflow.com/questions/742013/how-to-code-a-url-shortener/742047#742047 | |
| ALPHABET = | |
| "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789".split(//) | |
| # make your own alphabet using: | |
| # (('a'..'z').to_a + ('A'..'Z').to_a + (0..9).to_a).shuffle.join |
This file contains hidden or 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
| # simple HTTPServer: | |
| # useful to test your pages/api calls! | |
| class HTTPServer | |
| def initialize(port, body) | |
| require 'socket' | |
| @server = Thread.new do | |
| server = TCPServer.open port | |
| loop do |
This file contains hidden or 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
| # Author: Pieter Noordhuis | |
| # Description: Simple demo to showcase Redis PubSub with EventMachine | |
| # | |
| # Update 7 Oct 2010: | |
| # - This example does *not* appear to work with Chrome >=6.0. Apparently, | |
| # the WebSocket protocol implementation in the cramp gem does not work | |
| # well with Chrome's (newer) WebSocket implementation. | |
| # | |
| # Requirements: | |
| # - rubygems: eventmachine, thin, cramp, sinatra, yajl-ruby |
#Thread-safe JRuby on Rails HOW-TO
###With the help of Warbler, Apache Tomcat and JNDI Connection Pool
###Read those posts before anything else otherwise you'll find yourself in a very lonely place: