Skip to content

Instantly share code, notes, and snippets.

View briandemant's full-sized avatar
💭
is happy coding

Brian Demant briandemant

💭
is happy coding
View GitHub Profile
var dom = Bloop.dom;
var Box = Bloop.createClass({
getInitialState: function() {
return { number: 0 };
},
updateNumber: function() {
this.state.number++;
},
(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(": ");
$ cat test.js
function foo () { while (true) { } }
function bar () { return foo(); }
bar();
$ node test.js &
$ gdb attach $(pidof node)
0x00000bf778c63d5f in ?? ()
(gdb) b v8::internal::Runtime_StackGuard
Breakpoint 1 at 0x84a1f0
(gdb) print 'v8::V8::TerminateExecution'(0)
<!doctype html>
<html ng-app="Demo" ng-controller="AppController">
<head>
<meta charset="utf-8" />
<title>
Cross-Fading Images With AngularJS
</title>
<style type="text/css">
<!doctype html>
<html ng-app="Demo" ng-controller="AppController">
<head>
<meta charset="utf-8" />
<title>
Lazy Loading Images With AngularJS
</title>
<style type="text/css">
#!/bin/bash
# Update System
echo "System Update"
aptitude update > /dev/null
echo "Update completed"
# Install help app
aptitude install libssl-dev git-core pkg-config build-essential curl gcc g++ checkinstall
# prepare working dir
@briandemant
briandemant / README.md
Last active December 20, 2015 09:49 — forked from tmcw/README.md
@briandemant
briandemant / README.md
Last active December 19, 2015 04:19
testbed for d3js
@briandemant
briandemant / node.sh
Last active December 12, 2015 05:29
debian /etc/init.d/ scripts
#!/bin/sh
#
### BEGIN INIT INFO
# Provides: detector
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Should-Start: $network $time
# Should-Stop: $network $time
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
@briandemant
briandemant / rolling_avg.php
Created December 5, 2012 10:06
Redis snippits
$r = new Redis();
$r->connect("127.0.0.1", "6379");
$expire = 5; // min, good values are 3 to 10.
$ip = $_SERVER["REMOTE_ADDR"]; // you can put session or user id here
$page = md5($_SERVER["REQUEST_URI"]);
$ts = time();