Skip to content

Instantly share code, notes, and snippets.

🐢
Learning rust and PostgreSQL

Lars-Magnus Skog ralphtheninja

🐢
Learning rust and PostgreSQL
Block or report user

Report or block ralphtheninja

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@creationix
creationix / chatServer.js
Created Nov 19, 2010
A simple TCP based chat server written in node.js
View chatServer.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
@joelnet
joelnet / example.html
Created Jun 3, 2011
Unobtrusive Knockout support library for jQuery
View example.html
Choose a ticket class: <select id="tickets"></select>
<p id="ticketOutput"></p>
<script id="ticketTemplate" type="text/x-jquery-tmpl">
{{if chosenTicket}}
You have chosen <b>${ chosenTicket().name }</b>
($${ chosenTicket().price })
<button data-bind="click: resetTicket">Clear</button>
{{/if}}
@scottmessinger
scottmessinger / backbone-todos.js
Created Jun 19, 2011
Backbone.js todos vs knockout.js todos
We couldn’t find that file to show.
@aemkei
aemkei / LICENSE.txt
Created Oct 27, 2011 — forked from 140bytes/LICENSE.txt
Lorenz Attractor - 140byt.es
View LICENSE.txt
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@Raynos
Raynos / jQuery.md
Created Jan 14, 2012
Why you don't need jQuery
View jQuery.md

Why the jQuery Abstraction isn't needed.

(One needs some form of browser normalization so that modern features works, no-one is doubting that).

Related: [jQuery library critique][2]

Abstractions that aren't needed

Selectors

@Raynos
Raynos / weak-map.js
Last active Feb 21, 2018 — forked from Gozala/weak-map.js
Harmony WeakMap shim for ES5
View weak-map.js
// Original - @Gozola. This is a reimplemented version (with a few bug fixes).
window.WeakMap = window.WeakMap || (function () {
var privates = Name()
return {
get: function (key, fallback) {
var store = privates(key)
return store.hasOwnProperty("value") ?
store.value : fallback
},
@JasonMore
JasonMore / backbone.htm
Created Apr 2, 2012
Backbone.js TODO app implemented in knockout.js
View backbone.htm
<!DOCTYPE html>
<html lang="en">
<head>
<title>Backbone.js Todos</title>
<link rel="stylesheet" href="todos.css"/>
</head>
<body>
@ralphtheninja
ralphtheninja / node-and-npm-in-30-seconds.sh
Created May 6, 2012 — forked from isaacs/node-and-npm-in-30-seconds.sh
Use one of these techniques to install node and npm without having to sudo. Discussed in more detail at http://joyeur.com/2010/12/10/installing-node-and-npm/ Note: npm >=0.3 is *safer* when using sudo.
View node-and-npm-in-30-seconds.sh
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl http://npmjs.org/install.sh | sh
@trevordixon
trevordixon / Routes.js
Last active May 9, 2016
Very simple Express-like routing for PhantomJS
View Routes.js
var Routes = (function() {
var _ = {}, ctor = function(){};
_.bind = function bind(func, context) {
var bound, args, slice = Array.prototype.slice;
args = slice.call(arguments, 2);
return bound = function() {
if (!(this instanceof bound)) return func.apply(context, args.concat(slice.call(arguments)));
ctor.prototype = func.prototype;
var self = new ctor;
var result = func.apply(self, args.concat(slice.call(arguments)));
@turtlesoupy
turtlesoupy / nginx.conf
Created Jul 8, 2012
node.js upstream nginx config
View nginx.conf
http {
proxy_cache_path /var/cache/nginx levels=1:2 keys_zone=one:8m max_size=3000m inactive=600m;
proxy_temp_path /var/tmp;
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
gzip on;
gzip_comp_level 6;
You can’t perform that action at this time.