Skip to content

Instantly share code, notes, and snippets.

View zkat's full-sized avatar
💭
Rusting it up

Kat Marchán zkat

💭
Rusting it up
View GitHub Profile
@zkat
zkat / INSTALL.md
Created February 21, 2014 02:36 — forked from namuol/INSTALL.md

rage-quit support for bash

HOW TO INSTALL

Put flip somewhere in your $PATH and chmod a+x it.

Copy fuck into ~/.bashrc.

@zkat
zkat / canjs-browserified.js
Last active August 29, 2015 13:56
CanJS browserify artifact generated from amd version
;(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
var can=require("can/util/library.js"),ThIsIsToTaLlYbeCaUsEiMlAzY=require("can/control/route.js"),ThIsIsToTaLlYbeCaUsEiMlAzY=require("can/model.js"),ThIsIsToTaLlYbeCaUsEiMlAzY=require("can/view/mustache.js"),ThIsIsToTaLlYbeCaUsEiMlAzY=require("can/component.js");module.exports=can;
},{"can/component.js":3,"can/control/route.js":7,"can/model.js":10,"can/util/library.js":20,"can/view/mustache.js":27}],2:[function(require,module,exports){
/*!
* jQuery JavaScript Library v2.1.0
* http://jquery.com/
*
* Includes Sizzle.js
* http://sizzlejs.com/
@zkat
zkat / logloc.js
Last active August 29, 2015 14:00
Log logger locations globally
var old = {};
module.exports = {
install: install,
uninstall: uninstall,
methods: ["log", "info", "warn", "error"]
};
install();
;;;
;;; Git utils
;;;
(require 'vc-git nil t)
(defcustom git-grep-switches "-E -I -nH -i --no-color"
"Switches to pass to `git grep'."
:type 'string)
(defun git-grep (regexp)
@zkat
zkat / gist:1930f5b34e2aae56b82c
Last active August 29, 2015 14:06
playing around with auto-filtered/mapped `can.List`
function test() {
var sourceList = new can.List();
var stream = sourceList.filteredStream(function(todo, map) {
if (!todo.attr("done")) {
todo.attr("steps").forEach(map);
}
});
var targetList = stream.toList();
sourceList.push({

Keybase proof

I hereby claim:

  • I am zkat on github.
  • I am zkat (https://keybase.io/zkat) on keybase.
  • I have a public key whose fingerprint is AADE A47E 34FE F0D4 7EB7 F1BF 6FF7 93FB BD6F E1B5

To claim this, I am signing this object:

Keybase proof

I hereby claim:

  • I am zkat on github.
  • I am zkat (https://keybase.io/zkat) on keybase.
  • I have a public key whose fingerprint is 3F34 D66F DA3A B6B2 4887 2174 AEB5 29C0 8A3C 7E9E

To claim this, I am signing this object:

@zkat
zkat / gist:441379747a61beece62c
Last active August 29, 2015 14:24
Javascript translation of writing inline caching through load-time-value and inlining.

Base code

Consider the following code, and how it can be affected by the following transformations:

function foo () {
  return {x: 5}
}
foo() === foo() // => false
@zkat
zkat / gist:4611
Last active August 29, 2015 14:24
(defun get-input-from-client (client)
(let* ((stream (usocket:socket-stream (socket client)))
(collected-bytes (loop with b
do (setf b (read-byte stream))
until (= b (char-code #\Newline))
unless (not (standard-char-p (code-char b)))
collect (code-char b))))
(coerce collected-bytes 'string)))
@zkat
zkat / gist:5136
Last active August 29, 2015 14:34
(defclass client ()
((server :accessor client-server :initarg :server)
(thread :accessor client-thread)
(listener-thread :accessor client-listener-thread)
(socket :reader client-socket :initarg :socket :type usocket)
(event-queue :reader client-event-queue :initform (make-empty-queue)
:type queue)
(ip-addr :reader client-ip-addr :initarg :ip-addr :type string)
(exit-requested-p :accessor client-exit-requested-p :initform nil)))