Skip to content

Instantly share code, notes, and snippets.

View DekusDenial's full-sized avatar

D Morty k DekusDenial

  • United States
View GitHub Profile
@DekusDenial
DekusDenial / perf.md
Created November 14, 2015 07:12 — forked from thlorenz/perf.md
perf related one liners

perf list

pl-csv alias

Remove first 3 lines of perf list output and join the remaining ones together with ,

alias pl-csv='tail -n+3 | grep -v ^$ | awk '\''{print $1}'\'' | tr "\\n" "," | sed -e s/,$//'
@DekusDenial
DekusDenial / .generating-xcode-via-gyp.md
Created November 14, 2015 07:12 — forked from thlorenz/.generating-xcode-via-gyp.md
Generating Xcode projects from Node.js binding repos via gyp

This is specifically tailored to Node.js binding projects in which case the C++ layer is always a library.

Clone gyp:

git clone --depth 1 https://chromium.googlesource.com/external/gyp.git gyp

Add the below common.gypi file in the root of the project.

@DekusDenial
DekusDenial / steps-lldb-jit-on-osx.md
Created November 14, 2015 07:09 — forked from thlorenz/steps-lldb-jit-on-osx.md
lldb JIT on OSX (showing no useful info at this point)

Installation

Ninja

  • needed for faster Node.js builds
brew install ninja
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<title>One Graph</title>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.v2.js"></script>
<script type="text/javascript" src="simple-graph.js"></script>
<style type="text/css">
body { font: 13px sans-serif; }
rect { fill: #fff; }
(function () {
'use strict';
var DEFAULT_MAX_DEPTH = 6;
var DEFAULT_ARRAY_MAX_LENGTH = 50;
var seen; // Same variable used for all stringifications
Date.prototype.toPrunedJSON = Date.prototype.toJSON;
String.prototype.toPrunedJSON = String.prototype.toJSON;
@DekusDenial
DekusDenial / mytheme.zsh-theme
Created November 17, 2013 06:11
my zsh theme
# PROMPT='
# %{$fg[red]%}⌈ %{$fg[white]%}%n%{$fg[red]%} ⌋ %{$fg[blue]%}➤➤➤ %{$fg[red]%}❝ %{$fg[yellow]%}$(get_pwd) %{$fg[red]%}❞ %{$(put_spacing)%}%{$fg[cyan]%}%{$(git_prompt_info)%}
# %{$fg[magenta]%}%i %{$fg[red]%}⚡%{$fg[red]%}%@ %{$fg[red]%}➜ %{$reset_color%}'
PROMPT='
%{$fg[red]%}⌈ %{$fg[white]%}%n%{$fg[red]%} ⌋ %{$fg[blue]%}➤➤➤ %{$fg[red]%}❝ %{$fg[yellow]%}$(get_pwd) %{$fg[red]%}❞ %{$fg[cyan]%}%{$(git_prompt_info)%}
%{$fg[magenta]%}%i %{$fg[red]%}⚡%{$fg[red]%}%@ %{$fg[red]%}➜ %{$reset_color%}'
function get_pwd() {
echo "${PWD/$HOME/~}"
@DekusDenial
DekusDenial / Y.js
Created October 7, 2013 04:36
Y Combinator in Javascript
function Y(f) {
var g = function(h) {
return function(x) {
return f(h(h))(x);
};
};
return g(g);
}
@DekusDenial
DekusDenial / rebase_upstream
Created October 3, 2013 03:39
Loop through all the forked repos, update the remote upstream and rebase it with the current local HEAD. With '-f' flag to push after performing the tasks above, for each repo.
#!/usr/bin/env sh
push=0
if [[ $# -eq 1 && $1 -eq '-f' ]]; then
push=1
fi
T1=$(date +%s)
cwd=$(pwd)
@DekusDenial
DekusDenial / fetch_upstream
Created October 3, 2013 03:37
First, clone your forked repo. Second, set remote upstream to be the repo your repo forking from. Last, rebase the current HEAD with the remote HEAD
#!/usr/bin/env sh
repo=$( echo $1 | sed -E 's/^.*\///' | sed -E 's/\.git//' )
echo "\n<<<<<<<<< Cloning [${repo}] from [${1}] >>>>>>>>>"
T1=$(date +%s)
git clone $1 && cd $repo
HEAD=$( git rev-parse --abbrev-ref HEAD )
(function() {
var CSSCriticalPath = function(w, d, opts) {
var opt = opts || {};
var css = {};
var pushCSS = function(r) {
if(!!css[r.selectorText] === false) css[r.selectorText] = {};
var styles = r.style.cssText.split(/;(?![A-Za-z0-9])/);
for(var i = 0; i < styles.length; i++) {
if(!!styles[i] === false) continue;
var pair = styles[i].split(": ");