Skip to content

Instantly share code, notes, and snippets.

View felixrabe's full-sized avatar
🦀
Focusing on Rust

Felix Rabe felixrabe

🦀
Focusing on Rust
View GitHub Profile
@felixrabe
felixrabe / gist:98c3852a75313fc2afa2
Created May 8, 2014 17:34
Debug shell arguments
node -e 'console.log(process.argv.splice(1))' -- "`echo "1 2"`"
@felixrabe
felixrabe / string-utils.coffee
Last active September 29, 2023 16:39
CoffeeScript: String.startsWith() and String.endsWith()
# http://stackoverflow.com/a/646643
String::startsWith ?= (s) -> @slice(0, s.length) == s
String::endsWith ?= (s) -> s == '' or @slice(-s.length) == s
unalias l 2> /dev/null || true
function l() {
if [[ $# = 0 ]] ; then
arg=.
else
arg=$1
fi
if [[ -d $arg ]] ; then
ls -al "$arg"
@felixrabe
felixrabe / fibers-2.patch
Created March 1, 2014 21:07
node-fibers (d1d59a9f55e269d) patch for node-webkit (0.9.2) based on https://github.com/rogerwang/node-webkit/issues/533#issuecomment-32596155
--- ./node_modules/fibers/src/coroutine.cc-0 2014-03-01 22:05:44.000000000 +0100
+++ ./node_modules/fibers/src/coroutine.cc 2014-03-01 22:05:55.000000000 +0100
@@ -40,7 +40,7 @@
v8::Locker locker(isolate);
assert(isolate != NULL);
floor_thread_key = 0x7777;
- for (pthread_key_t ii = coro_thread_key - 1; ii >= (coro_thread_key >= 20 ? coro_thread_key - 20 : 0); --ii) {
+ for (pthread_key_t ii = coro_thread_key - 1; ii >= (coro_thread_key >= 30 ? coro_thread_key - 30 : 0); --ii) {
if (pthread_getspecific(ii) == isolate) {
floor_thread_key = ii;
@felixrabe
felixrabe / git-exec
Last active December 23, 2015 09:09
git-exec
#!/bin/bash
# Author: Felix Rabe
# Public Domain, available from https://gist.github.com/felixrabe/6612477
# Like 'git cherry-pick' with added execution support.
# When it sees that the commit message starts with '$ ', it will execute the
# commit, then create a new commit with all the changes, instead of just
# cherry-picking.
@felixrabe
felixrabe / nsum
Created September 14, 2013 08:53
nsum
#!/usr/bin/env coffee
byline = require 'byline' # v. 3.1.2
stream = byline process.stdin
sum = 0
stream.on 'data', (line) ->
sum += parseInt line
@felixrabe
felixrabe / Typo3-RTE.md
Last active December 21, 2015 20:48
Alternativen zum Typo3 RTE HTML Editor

rtehtmlarea-Ersatz

Stand: 28. August 2013, von Felix Rabe.

Problem

Das Update von TYPO3 Version 4.4 auf Version 4.5 bereitet im IE 8 Probleme mit rtehtmlarea. Das Debugging gestaltet sich schwierig. Deshalb wird erwogen, ein RTE-Plugin als Alternative zu rtehtmlarea einzusetzen.

13-08-21 09:15:30 19793 CRITICAL Flow Uncaught exception #1355480641 in line 227 of /Users/felixrabe/Sites/eis-flow-mamp/Packages/Framework/TYPO3.Flow/Classes/TYPO3/Flow/Core/Booting/Scripts.php: Execution of subprocess failed with exit code 255 and no output.
The erroneous command was:
FLOW_ROOTPATH='/Users/felixrabe/Sites/eis-flow-mamp/' FLOW_CONTEXT='Development' XDEBUG_CONFIG='idekey=FLOW_SUBREQUEST remote_port=9001' "/Applications/MAMP/bin/php/php5.4.10/bin/php" -c '/Library/Application Support/appsolute/MAMP PRO/conf/php.ini' '/Users/felixrabe/Sites/eis-flow-mamp/Packages/Framework/TYPO3.Flow/Classes/TYPO3/Flow/Core/../../../../Scripts/flow.php' 'typo3.flow:core:compile' - See also: 201308210915240306a9.txt
@felixrabe
felixrabe / gitrl
Last active December 20, 2015 19:29
gitrl
#!/bin/bash
n=50 # default
if [[ $1 != "do" && $1 != "undo" ]] ; then
echo "Usage: gitrl { do [N=$n] | undo }"
exit 1
fi
n=${2:-$n}
#!/usr/bin/env coffee
readline = require 'readline'
occ = Object.create null
# http://stackoverflow.com/a/15554600
rd = readline.createInterface
input: process.stdin
output: process.stdout