Skip to content

Instantly share code, notes, and snippets.

# 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
#
/* Ejs parser for Nodejs
*
* Copyright (c) 2009, Howard Rauscher
* Licensed under the MIT License
*/
// PUBLIC METHODS
function parse(input) {
var output = [];
var innerOutput = [];
#! /bin/sh
### BEGIN INIT INFO
# Provides: supervisord
# Required-Start: $remote_fs
# Required-Stop: $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Example initscript
# Description: This file should be used to construct scripts to be
# placed in /etc/init.d.
@mlzboy
mlzboy / gist:656656
Created October 31, 2010 14:33 — forked from fredwu/gist:580095
source 'http://rubygems.org'
# --------------------
# Rails
# --------------------
gem 'rake'
gem 'arel', :git => 'git://github.com/rails/arel.git'#, :branch => '1-0-stable'
# gem 'rails', '~> 3.0.0'
gem 'rails', :git => 'git://github.com/rails/rails.git', :branch => '3-0-stable'
/* Red button theme for JQuery Mobile
* - Use data-theme="r" for red versions of the default JQuery Mobile Buttons.
******************************************************************************************/
.ui-btn-up-r {
border: 1px solid #721414;
background: #AB2525;
font-weight: bold;
color: #fff;
text-shadow: 0 -1px 1px #000;
@mlzboy
mlzboy / config.json
Created April 30, 2018 01:06 — forked from wd/config.json
基于 3.8.6 以上 ss 版本的方案
{
"log": {
"loglevel": "none"
},
"inbound": {
"port": 23456,
"listen": "127.0.0.1",
"protocol": "socks",
"settings": {
"udp": true
@mlzboy
mlzboy / graphviz.html
Created August 10, 2018 07:23 — forked from afomi/graphviz.html
Graphviz Example
<script type="text/vnd.graphviz" id="graphviz">
digraph G {
"browser" ->
"http_request" ->
"server" ->
"routes" ->
"controller" ->
"model" -> "controller"
"controller" -> "response"
"response" -> "view" -> "html"
@mlzboy
mlzboy / Selenium.Python.InjectJS.py
Created September 16, 2018 20:14 — forked from anhldbk/Selenium.Python.InjectJS.py
Inject jQuery into Selenium Driver
from selenium import webdriver
driver = webdriver.Firefox()
driver.get('https://www.facebook.com/')
with open('jquery-1.9.1.min.js', 'r') as jquery_js:
jquery = jquery_js.read() #read the jquery from a file
driver.execute_script(jquery) #active the jquery lib
driver.execute_script("$('#email').text('anhld')")
import time,urllib2
from selenium import webdriver
_init_js="""
(function (){
if (window.__e)
{ return;
}
var e=document.createElement('div');
e.setAttribute("id","__s_msg");
e.style.display="none";
// ==UserScript==
// @name New Script
// @namespace Violentmonkey Scripts
// @match *://*/*
// @grant none
// @grant GM_setValue
// @grant GM.getValue
// ==/UserScript==
var i = 1;
var num = 2;