Skip to content

Instantly share code, notes, and snippets.

customizable css brower

Easily show case your work, just add a background-image to .content and change the url.

A Pen by Paul Serraino on CodePen.

License.

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Violations</title>
<style>
body {
padding: 20px;
font-family: "helvetica neue", helvetica;
}
//returns an array of methods
Object.prototype.methods = function () {
var m = [], k;
for (k in this)
if (typeof this[k] === "function") m.push(k);
return m;
};
Object.prototype.hasMethod = function (m) {
return m in this && typeof this[m] === "function";
@paulserraino
paulserraino / bitwise-func
Last active August 29, 2015 14:16
bitwise anonymous functions
~~function (a) {
return a ^ function () { // 1 ^ 2
return a << 1 | function () { // 2 | 0
return a << 1 & function () { // 2 & 1
return a; // 1
}()
}()
}()
}(1)
// 3
@paulserraino
paulserraino / test.js
Last active August 29, 2015 14:23
testing secure routes
var assert = require('assert')
var request = require('request')
describe('My API', function () {
// initialize request cookie jar
request = request.defaults({ jar: request.jar() })
var cred = {
username: 'foo'
@paulserraino
paulserraino / default_eval.js
Created June 29, 2015 19:27
default eval from node core
var repl = require('repl');
var debug = require('debuglog');
var vm = require('vm');
// copy pasta from node source
// lib/repl.js
function defaultEval(code, context, file, cb) {
var err, result;
// first, create the Script object to check the syntax
try {
@paulserraino
paulserraino / work_repl.js
Created June 29, 2015 19:34
sample custom node repl
var repl = require('repl');
var path = require('path');
var r = repl.start();
require('repl.history')(r, path.join(process.env.HOME, '.node_history');
var caterDir = '../cater-api-server' || process.argv[2];
r.context.models = require(path.join(caterDir, 'models');
@paulserraino
paulserraino / app.js
Last active August 29, 2015 14:27
Updating a collection of child components
var React = require('react');
/**
* Input
*/
var Input = React.createClass({
getInitialState: function () {
return { name: this.props.name || '' }
},
@paulserraino
paulserraino / atx_coffee_pw.md
Last active August 29, 2015 14:27
Coffee Shop Passwords Austin, Tx

Coffee Shop Passwords

Name                           Password
-----------------------------------------------
Corona Cafe                    luckycharms
Houndstooth Coffee             coffeeandcheese

Brew & Brew coffeeandbeer

@paulserraino
paulserraino / review.sh
Last active November 11, 2015 17:13
automating my goodybag review process
#!/usr/bin/env bash
# ./review.sh [branch id]
#example.
# ./review.sh 1947
if [ "$GITHUB_TOKEN" == "" ] ; then
echo "Error! You need to set GITHUB_TOKEN environment variable!"
exit 1