Skip to content

Instantly share code, notes, and snippets.

View markbrown4's full-sized avatar

Mark Brown markbrown4

View GitHub Profile
@markbrown4
markbrown4 / gulpfile.js
Last active August 29, 2015 14:00
gulpfile for compiling coffee, sass/autoprefixer and handlebars.
var gulp = require('gulp');
var gutil = require('gulp-util');
var sass = require('gulp-sass');
var coffee = require('gulp-coffee');
var autoprefix = require('gulp-autoprefixer');
var handlebars = require('gulp-handlebars');
var defineModule = require('gulp-define-module');
var paths = {
scripts: {
@markbrown4
markbrown4 / diamonds.html
Last active August 29, 2015 14:05
CSS triangles
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>diamonds</title>
<style type="text/css">
#diamonds {
width: 480px;
height: 480px;
@markbrown4
markbrown4 / angular-fuzzy-search.html
Last active August 29, 2015 14:05
Angular's fuzzy search
<input type="text" placeholder="Search for your team" ng-model="team_query">
<ul class="teams" ng-show="team_query.length > 2">
<li ng-repeat="team in teams | filter : team_query | limitTo : 5">
<img ng-src="{{ team.avatar_url }}">
<h2>{{ team.name }}</h2>
<small>{{ team.member_count }}</small>
<p>{{ team.bio }}</p>
</li>
</ul>
@markbrown4
markbrown4 / nesting.scss
Created October 2, 2014 23:14
css nested selectors
/* It's common to want to make the selector nesting the same as the dom */
#content {
.nav {
ul {
margin: 0;
padding: 0;
li {
float: left;
margin: 0;
@markbrown4
markbrown4 / new-york.md
Created October 8, 2014 21:58
Places in New York - The definitive guide

Places to eat

ShakeShack

@markbrown4
markbrown4 / csrf.md
Created May 4, 2015 06:34
csrf token error in chrome
  1. run server
  2. login
  3. stop server
  4. run server again
  5. logout
  6. login

💥 ActionController::InvalidAuthenticityToken

var express = require('express')
, http = require('http')
, async = require('async')
, multer = require('multer')
, upload = multer({ dest: 'uploads/' })
, exphbs = require('express-handlebars')
, easyimg = require('easyimage')
, _ = require('lodash')
, cv = require('opencv');
/*
* mQuery, My journey into the world of js libraries
* Selectors, Events, DOM, Ajax and Animation
*/
var $ = (function() {
/*!
* Sizzle CSS Selector Engine - v1.0
* Copyright 2009, The Dojo Foundation
* Released under the MIT, BSD, and GPL Licenses.
@markbrown4
markbrown4 / button-lol.email.html
Created September 7, 2015 07:17
That's not a button. This is a button.
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<div>
<!--[if mso]>
<v:roundrect xmlns:v="urn:schemas-microsoft-com:vml" xmlns:w="urn:schemas-microsoft-com:office:word" href="http://litmus.com" style="height:36px;v-text-anchor:middle;width:150px;" arcsize="5%" strokecolor="#EB7035" fillcolor="#EB7035">
<w:anchorlock/>
<center style="color:#ffffff;font-family:Helvetica, Arial,sans-serif;font-size:16px;">I am a button &rarr;</center>
</v:roundrect>
<![endif]-->