Skip to content

Instantly share code, notes, and snippets.

View aweary's full-sized avatar
🌐
doing things and stuff

Brandon Dail aweary

🌐
doing things and stuff
View GitHub Profile
@aweary
aweary / gist:a8a28f73bc4707539dac
Last active October 21, 2015 05:05
microbe.js example
import microbe from 'microbe.js'
const app = microbe(__dirname)
app.route({
path: '/',
method: 'GET',
handler: duplex => duplex.render('index', {content: 'This is content!'})
})
app.on('start', () => {
@aweary
aweary / gist:04938e4a42c6f224ab2c
Last active August 29, 2015 14:25
grasp.html
<div data-grasp-template='main' class='container'>
<div class='header'>
<h1 class='title'> Welcome to #{title}, on #{date}! </h1>
<h3 class='sub-title'> #{subtitle} </h3>
<span> #{time} </span>
</div>
<div class='post-container'>
<div class='post' data-repeat='post in posts'>
@aweary
aweary / gist:9a0ee2a238ef38b9cd75
Last active August 29, 2015 14:25
gists.scss
$gist: (
background: #EEEEEE,
color: #333333,
border: none,
colors: #04DBAC #B52A1D #1D5CB5 #31AFD4 #FE9000 #FFDD4A #094074,
line-numbers-bg: #EEEEEE,
line-numbers-color: #B52A1D,
line-numbers-border: none,
meta-display: block
);
<html class="no-js" lang="">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title></title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- <link rel="apple-touch-icon" href="apple-touch-icon.png"> -->
<link href='http://fonts.googleapis.com/css?family=Roboto+Mono' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="./tmp/styles/main.css">
#!/usr/bin/python
# List the account and human names from the passwd file in sorted order.
# If there is no human name, or it equals the userid, then the name is
# printed as [ none ]. The program reads from the file given the command
# line, if any, else it reads from /etc/passwd. If the file open fails, the
# program will die on an exception.
# The from form of of import adds name to the symbol table of the
# importing program, so that the names may be refered to without
$gist: (
background: #263238,
color: white,
border: none,
padding: 3em,
colors: $pink $cyan $blue $red $yellow $paleyellow $orange $purple,
line-numbers-bg: $darkblue,
line-numbers-color: white,
line-numbers-border: none,
@aweary
aweary / gist:aac594b907e12a91c285
Created September 17, 2015 16:10
Readable Stream in raw-body
ReadableState {
objectMode: false,
highWaterMark: 16384,
buffer: [],
length: 0,
pipes: null,
pipesCount: 0,
flowing: true,
ended: true,
endEmitted: true,
@aweary
aweary / scope.js
Last active January 10, 2016 00:59
/*
A scope is basically the context in which a variable is accesible. There are two types of scopes in JS: global and local.
The global scope is the topmost scope. You create local scopes with funcitons. Variables declared within funcitons
are "scoped" to that function, and those variables are only accessible to scopes that are children of that scope.
Think of them as nested containers.
*/
// This variable is within the global scope since its not declared within and function.
var global = "I am global!"
#chatlio-widget {
/* All styles when chat window is collapsed */
.chatlio-widget.closed {
transition-duration: 0s;
bottom: 30px;
right: 30px;
border-radius: 100%;
@media screen and (min-width: 800px) {
@aweary
aweary / predicate.js
Last active November 10, 2016 15:54
Predicate logic in Javascript
const nand = (x, y) => !(x && y)
const not = (x) => nand(x, x)
const and = (x, y) => not(nand(x, y))
const or = (x, y) => nand(not(x), not(y))