Skip to content

Instantly share code, notes, and snippets.

@summivox
summivox / tocsv.js
Last active January 4, 2016 21:49 — forked from JeffJacobson/tocsv.js
/*!
* https://gist.github.com/JeffJacobson/2770509
* https://gist.github.com/smilekzs/8683955
* Licensed under The MIT License
*/
/**
* Converts a value to a string appropriate for entry into a CSV table. E.g., a string value will be surrounded by quotes.
* @param {string|number|object} theValue
*/
#ifndef __generator_h__
#define __generator_h__
// generator/continuation for C++
// author: Andrew Fedoniouk @ terrainformatica.com
// idea borrowed from: "coroutines in C" Simon Tatham,
// http://www.chiark.greenend.org.uk/~sgtatham/coroutines.html
struct _generator
{
BEFOREHAND: close door, each window & exit; wait until time.
open spellbook, study, read (scan, select, tell us);
write it, print the hex while each watches,
reverse its length, write again;
kill spiders, pop them, chop, split, kill them.
unlink arms, shift, wait & listen (listening, wait),
sort the flock (then, warn the "goats" & kill the "sheep");
kill them, dump qualms, shift moralities,
values aside, each one;
die sheep! die to reverse the system
@summivox
summivox / tag-inside-inline-code.md
Created August 25, 2013 07:48
testcase for editorially faulty import

`` should be converted to inline code block, not inline HTML.

@summivox
summivox / install.bat
Created August 5, 2013 00:40
install script for 7+ Taskbar Numberer
:: References:
:: http://www.downloadcrew.com/article/27967-7_taskbar_numberer
:: http://www.optimumx.com/downloads.html#Shortcut
@echo off
SET lnk="%appdata%\Microsoft\Windows\Start Menu\Programs\Startup\taskbar.lnk"
SET me="%~dp07+ Taskbar Numberer.exe"
del %lnk% /F 2>&1 >nul
shortcut /F:%lnk% /A:C /T:%me% /P:"-v2 -v3 -hidewnd"
net = require 'net'
http = require 'http'
{parse} = require 'url'
# default port of proxy
PORT = 8888
# headers to be stripped (lower-case)
BAN_LIST = [
'connection'
@summivox
summivox / kisume.readme.md
Last active December 20, 2015 03:29
kisume: README.md (v1.0.0)

Kisume

Kisume

Kisume (pronounced: kee-ss-may) is a library written in [coffee-script][coffee] for cross-browser userscripting that works around the limitation of sandboxes using only standard DOM manipulation, while featuring a clean, node.js-inspired interface.

The name (and mascot) comes from the Touhou Project.

await window.kisume = Kisume window, defer()
console.log '===begin kisume test==='
await kisume.set 'namespace', [], {
var1: {x: 1, y: 2}
var2: {x: -3, y: 4}
func1: (a, b) -> {x: a.x + b.x, y: a.y + b.y}
func2: (o) -> window.o = @func1(@var1, o)
func3: (o, cb) -> setTimeout (=> cb null, o, @func2(o)), 1000
}, defer(err)
@summivox
summivox / export.coffee
Last active December 20, 2015 01:19
browser / node library export snippets
((exp) ->
# exp.blah = blah
) switch
when module?.exports then module.exports
when window? then window
@summivox
summivox / renren-markdown.user.js
Last active August 28, 2016 15:58
renren-markdown v1.0.0 preview (2013-11-06)
// Copyright (c) 2013, smilekzs. (MIT Licensed)
// ==UserScript==
// @name renren-markdown
// @namespace http://github.com/smilekzs
// @version 1.0.0
// @description Powerful markdown-based editor for blog.renren.com
// @grant GM_xmlhttpRequest
// @match *://blog.renren.com/blog/*Blog*
// @match *://blog.renren.com/blog/*edit*
// @match *://blog.renren.com/*Entry*