Skip to content

Instantly share code, notes, and snippets.

View lewangdev's full-sized avatar
🐢
Running

LE lewangdev

🐢
Running
View GitHub Profile
@cowboy
cowboy / HEY-YOU.md
Last active February 27, 2025 12:24
jQuery Tiny Pub/Sub: A really, really, REALLY tiny pub/sub implementation for jQuery.
@jfsiii
jfsiii / node-flot.js
Created November 20, 2010 21:22
Creating a Flot chart using node-canvas
var document = require("jsdom").jsdom(),
window = document.createWindow(),
jQuery = require('jquery').create(window),
fs = require('fs'),
script = document.createElement("script");
window.Canvas = require('canvas');
script.src = 'https://gist.github.com/raw/790339/3b0171c3e9b749bb93fff5d642eaa687f02939a5/jquery.flot.node-canvas.js';
script.onload = function ()
{
@didip
didip / tornado_cookie_secret_generator.py
Created February 12, 2011 17:20
Generates secure cookie secret for Tornado Web Framework
#!/usr/bin/env python
import sys, os, time, atexit
from signal import SIGTERM
class Daemon:
"""
A generic daemon class.
Usage: subclass the Daemon class and override the run() method
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active June 14, 2025 04:09
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@UniIsland
UniIsland / SimpleHTTPServerWithUpload.py
Created August 14, 2012 04:01
Simple Python Http Server with Upload
#!/usr/bin/env python
"""Simple HTTP Server With Upload.
This module builds on BaseHTTPServer by implementing the standard GET
and HEAD requests in a fairly straightforward manner.
"""
@josegonzalez
josegonzalez / nginx_release.sh
Last active March 20, 2025 21:13
Make an nginx release for ubuntu
#!/bin/bash
#####
# Builds a custom nginx
#
# RELEASE_TAGS="+your+tags+here"
# RELEASE_MAINTAINER="Your Name Here"
# RELEASE_MAINTAINER_EMAIL="[email protected]"
# RELEASE_MESSAGE="Some message"
#
@josegonzalez
josegonzalez / access.lua
Created December 3, 2012 18:26
Simple lua file enabling oauth support for nginx via nginx-lua and access_by_lua.
- certain endpoints are always blocked
if nginx_uri == "/_access_token" or nginx_uri == "/_me" then
ngx.exit(403)
end
-- import requirements
local cjson = require "cjson"
-- setup some app-level vars
local app_id = "APP_ID"
@mocchira
mocchira / curl_range.md
Last active February 17, 2025 22:25
HTTP GET with Range header by curl
  • normal(explicitly specified start AND end)
  curl -v -X GET -H "range: bytes=1-8" http://localhost:8080/bbb/test
  • specified ONLY start(end will be specified at the end of file)
  curl -v -X GET -H "range: bytes=10-" http://localhost:8080/bbb/test
  • specified ONLY one negative value(last N bytes of file will be retrieved)
@bbirec
bbirec / gist:5748489
Last active June 7, 2019 00:56
ISO8601 Adapter for Gson.
package com.bbirec.dabang.common;
import com.google.gson.*;
import java.lang.reflect.Type;
import java.sql.Timestamp;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;