This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
char* ConvertUnicodeToMultybyte(CString strUnicode) | |
{ | |
int nLen = WideCharToMultiByte(CP_ACP, 0, strUnicode, -1, NULL, 0, NULL, NULL); | |
char* pMultibyte = new char[nLen]; | |
memset(pMultibyte, 0x00, (nLen)*sizeof(char)); | |
WideCharToMultiByte(CP_ACP, 0, strUnicode, -1, pMultibyte, nLen, NULL, NULL); | |
return pMultibyte; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun check-expansion () | |
(save-excursion | |
(cond ((looking-at "\\_>") t) | |
((unless (bobp) (backward-char 1) (looking-at "\\.")) t) | |
((unless (bobp) (backward-char 1) (looking-at "->")) t) | |
(t nil)))) | |
(defun smart-tab (&optional prefix) | |
"This smart tab is minibuffer compliant: it acts as usual in | |
the minibuffer. Else, if mark is active, indents region. Else if |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script> | |
<script type="text/javascript"> | |
$(function() { | |
window.WebSocket = window.WebSocket || window.MozWebSocket; | |
var websocket = new WebSocket('ws://127.0.0.1:9999','dumb-increment-protocol'); | |
websocket.onopen = function () { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn listen-cigarette-burn [] | |
(if-let [cigaburn-dom (dom/getElement "cigarette-burn")] | |
(events/listen | |
cigaburn-dom | |
EventType.MOUSEMOVE | |
(fn [_] | |
(if-let [noticenter-dom (dom/getElement "notification-center")] | |
(when-not (classes/has noticenter-dom "reveal") | |
(classes/addRemove noticenter-dom "unreveal" "reveal") | |
;; (events/listenOnce |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="content-type" content="text/html;"> | |
<link href="app.gss" rel="stylesheet/gss" type="text/gss"> | |
</head> | |
<body> | |
<img id="cassowaryImg" src="http://gridstylesheets.org/assets/images/Intro/CassowaryBird.png" /> | |
<h1>Hello!</h1> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function sendPacket(stream, buffer) | |
{ | |
var prefix = new Buffer(4); | |
var length = buffer.length; | |
var offset = 0; | |
// serialize 32bit little endian unsigned int | |
prefix[offset++] = length & 0xff; | |
prefix[offset++] = (length >> 8) & 0xff ); | |
prefix[offset++] = (length >> 16) & 0xff ); | |
prefix[offset++] = (length >> 24) & 0xff ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn ->kebab [s] | |
(str/join "-" (map str/lower-case (re-seq #"\w[a-z]+" s)))) | |
(def components '[Card AppBar LeftNav CardTitle]) | |
(defn gen-wrapper [component] | |
`(defmacro ~(symbol (->kebab (str component))) [& args#] | |
(let [[opts# & [children#]] (if (-> args# first map?) | |
[(first args#) (rest args#)] | |
[nil args#])] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#_(boot.core/set-env! | |
:dependencies | |
'[[org.clojure/core.async "0.1.346.0-17112a-alpha" :scope "provided"]]) | |
;; https://github.com/clojure/core.async/wiki/Pub-Sub | |
(ns async | |
(:refer-clojure :exclude [reduce map into partition partition-by merge take]) | |
(:use clojure.core.async)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<body> | |
<style> | |
body {background-color: #fcfcfc;} | |
#main, footer {padding-left: 240px;} | |
#loader-wrapper { | |
position: fixed; | |
top: 0; | |
left: 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript: (function(e, t) { | |
var n = e.document; | |
setTimeout(function() { | |
function a(e) { | |
if (e.data === "destroy_bookmarklet") { | |
var r = n.getElementById(t); | |
if (r) { | |
n.body.removeChild(r); | |
r = null | |
} |