Skip to content

Instantly share code, notes, and snippets.

@Daniel15
Daniel15 / gist:7653825
Created November 26, 2013 05:20
Basic AJAX loading
/**
* Does an AJAX load of the specified URL
*
* @param {String} url URL to load
* @param {Object} data Hash of data to send in querystring
* @param {Function} callback Function to call once request returns
*/
function load(url, data, callback) {
if (data) {
var params = Object.keys(data)
@gr2m
gr2m / store.dreamcode.js
Last active February 23, 2020 00:03
Imagine saving and finding user data would work right in the browser, persistent and synchronised. How would the code look like? This is what I came up with. Forks & comments much appreciated! #nobackend #dreamcode
// add a new object
var type = 'note';
var attributes = {color: 'red'};
store.add(type, attributes)
.done(function (newObject) {});
.fail(function (error) {});
// update an existing object
var type = 'note';
var id = 'abc4567';
@tobym
tobym / redis_pubsub_demo.rb
Created April 1, 2010 16:50 — forked from pietern/redis_pubsub_demo.rb
Redis PubSub demo with EventMachine (chat service)
# Author: Pieter Noordhuis
# Description: Simple demo to showcase Redis PubSub with EventMachine
#
# Requirements:
# - rubygems: eventmachine, thin, cramp, sinatra, yajl-ruby
# - a browser with WebSocket support
#
# Usage:
# ruby redis_pubsub_demo.rb
#
@f5io
f5io / matrix3d.js
Last active June 2, 2023 11:27
Matrix3D implementation using Typed Arrays
(function(w) {
var Matrix3D = {};
Matrix3D._deg2rad = function(deg) {
return deg * (Math.PI / 180);
};
Matrix3D.create = function() {
var out, args = Array.prototype.slice.call(arguments);
@jlong
jlong / uri.js
Created April 20, 2012 13:29
URI Parsing with Javascript
var parser = document.createElement('a');
parser.href = "http://example.com:3000/pathname/?search=test#hash";
parser.protocol; // => "http:"
parser.hostname; // => "example.com"
parser.port; // => "3000"
parser.pathname; // => "/pathname/"
parser.search; // => "?search=test"
parser.hash; // => "#hash"
parser.host; // => "example.com:3000"
# Build an inverted index for a full-text search engine with Redis.
# Copyright (C) 2009 Salvatore Sanfilippo. Under the BSD License.
# USAGE:
#
# ruby invertedindex.rb add somedir/*.c
# ruby invertedindex.rb add somedir/*.txt
# ruby search your query string
require 'rubygems'
require 'redis'
@enricofoltran
enricofoltran / main.go
Last active April 1, 2024 00:17
A simple golang web server with basic logging, tracing, health check, graceful shutdown and zero dependencies
package main
import (
"context"
"flag"
"fmt"
"log"
"net/http"
"os"
"os/signal"
@vertexclique
vertexclique / cracking.md
Last active April 8, 2024 18:24
Cracking guide for Sublime Text 3 Build 3059 / 3065 ( Mac / Win x86_64 / Windows x86 / Linux x64 / Linux x86 )

MacOS

Build 3059

MD5: 59bab8f71f8c096cd3f72cd73851515d

Rename it to: Sublime Text

Make it executable with: chmod u+x Sublime\ Text

@zziuni
zziuni / stuns
Created September 18, 2012 08:05
STUN server list
# source : http://code.google.com/p/natvpn/source/browse/trunk/stun_server_list
# A list of available STUN server.
stun.l.google.com:19302
stun1.l.google.com:19302
stun2.l.google.com:19302
stun3.l.google.com:19302
stun4.l.google.com:19302
stun01.sipphone.com
stun.ekiga.net