Skip to content

Instantly share code, notes, and snippets.

View danmaispace's full-sized avatar
🎯
Focusing

Danmai danmaispace

🎯
Focusing
  • www.danmai.com.cn
  • Shenzhen,China
View GitHub Profile
@danmaispace
danmaispace / APOD-app-tap-listener.js
Created February 28, 2012 08:02 — forked from edspencer/APOD-app-tap-listener.js
The app.js file for a simple Sencha Touch 2 APOD app
/**
* The final thing is to add a tap listener that is called whenever the user taps on the screen.
* We do a quick check to make sure they're not tapping on the carousel indicators (tapping on
* those indicators moves you between items so we don't want to override that), then either hide
* or show the info Component.
*/
Ext.Viewport.element.on('tap', function(e) {
if (!e.getTarget('.x-carousel-indicator')) {
if (titleVisible) {
info.element.removeCls('apod-title-visible');
@danmaispace
danmaispace / gist:3856368
Created October 9, 2012 03:16 — forked from padolsey/gist:527683
Javascript: detect ie
// ----------------------------------------------------------
// A short snippet for detecting versions of IE in JavaScript
// without resorting to user-agent sniffing
// ----------------------------------------------------------
// If you're not in IE (or IE version is less than 5) then:
// ie === undefined
// If you're in IE (>=5) then you can determine which version:
// ie === 7; // IE7
// Thus, to detect IE:
// if (ie) {}
@danmaispace
danmaispace / writeup.md
Created October 12, 2012 02:10 — forked from cespare/writeup.md
A Simple Webserver Comparison

This is a very simple benchmark comparing the response times of a few different webservers for an extremely simple response: just reply with a snippet of static json. It came up in discussion of a real-life service: in the actual server, a long-running thread/process periodically updates the state from a database, but requests will be served with the data directly from memory. It is imperative, though, that the latencies be extremely low for this service.

This comparison was partly inspired by this blog post.

Method

require 'bundler/capistrano'
set :application, "net"
set :repository, "git@githost.com:net.git"
set :scm, :git
set :default_environment, {
'PATH' => "$HOME/.rbenv/shims:$HOME/.rbenv/bin:$PATH"
}
# 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
$server = "JZSOF-SQL01"
$user = "robert.toland"
$password = "N3wt0ns@ppl3!"
$database = "TmsEPrd"
sqlcmd -S $server -U $user -P $password -d $database -Q "Execute [dbo].[sofp_cnv001_create_transfer_data];"
@echo off
@rem ==================
@rem Source:
@rem https://gist.github.com/jcppkkk/8330314
@rem Description:
@rem Install context menu to allow user opens file with Sublime Text as User or Admin, or Open Folder with Sublime Text.
@rem Usage:
@rem Download this .bat file to in Sublime Text's installation folder.
@rem Execute this batch file. It will download elevate codes and setup context menu.
@rem ==================
@danmaispace
danmaispace / ADB.conf
Last active December 24, 2015 04:25 — forked from jason5ng32/surge.conf
Surge Configs ( Both 2 files are needed )
[General]
loglevel = notify
skip-proxy = 192.168.0.0/16, 10.0.0.0/8, 172.16.0.0/12,127.0.0.0/24,100.64.0.0/10
bypass-tun = 0.0.0.0/8, 1.0.0.0/9, 1.160.0.0/11, 1.192.0.0/11, 10.0.0.0/8, 14.0.0.0/11, 14.96.0.0/11, 14.128.0.0/11, 14.192.0.0/11, 27.0.0.0/10, 27.96.0.0/11, 27.128.0.0/9, 36.0.0.0/10, 36.96.0.0/11, 36.128.0.0/9, 39.0.0.0/11, 39.64.0.0/10, 39.128.0.0/10, 42.0.0.0/8, 43.224.0.0/11, 45.64.0.0/10, 47.64.0.0/10, 49.0.0.0/9, 49.128.0.0/11, 49.192.0.0/10, 54.192.0.0/11, 58.0.0.0/9, 58.128.0.0/11, 58.192.0.0/10, 59.32.0.0/11, 59.64.0.0/10, 59.128.0.0/9, 60.0.0.0/10, 60.160.0.0/11, 60.192.0.0/10, 61.0.0.0/10, 61.64.0.0/11, 61.128.0.0/10, 61.224.0.0/11, 100.64.0.0/10, 101.0.0.0/9, 101.128.0.0/11, 101.192.0.0/10, 103.0.0.0/10, 103.192.0.0/10, 106.0.0.0/9, 106.224.0.0/11, 110.0.0.0/7, 112.0.0.0/9, 112.128.0.0/11, 112.192.0.0/10, 113.0.0.0/9, 113.128.0.0/11, 113.192.0.0/10, 114.0.0.0/9, 114.128.0.0/11, 114.192.0.0/10, 115.0.0.0/8, 116.0.0.0/8, 117.0.0.0/9, 117.128.0.0/10, 118.0.0.0/11, 118.64.0.0/10, 118.128.0.0
@danmaispace
danmaispace / private.xml
Created April 5, 2016 09:19 — forked from pjan/private.xml
Karabiner private.xml for Topre REALFORCE 87U on Mac
<?xml version="1.0"?>
<root>
<item>
<name>For Topre REALFORCE 87 Users</name>
<devicevendordef>
<vendorname>TopreCorporation</vendorname>
<vendorid>0x0853</vendorid>
</devicevendordef>
<item>