Skip to content

Instantly share code, notes, and snippets.

View marcusandre's full-sized avatar

marcusandre

  • Germany
View GitHub Profile
@marcusandre
marcusandre / gist:9367067
Created March 5, 2014 13:23
Do something every day from today for one week.
/**
* Module dependencies.
*/
var moment = require('moment');
// weekdays
var weekdays = [
@marcusandre
marcusandre / grid.css
Created July 23, 2014 09:28
table based grid-system
@media (min-width: 37.5em) {
.row { width: 100%; display: table; table-layout: fixed; }
.col { display: table-cell; }
}
@marcusandre
marcusandre / .gitignore
Created October 4, 2015 20:39
node module ignored files list
# files
.DS_Store
npm-debug.log
# folders
build/
coverage/
node_modules/
@marcusandre
marcusandre / install_mongo.sh
Last active October 9, 2015 21:38
install MongoDB on Ubuntu 12.04 LTS
#!/bin/bash
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv 7F0CEB10
echo "deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen" | tee -a /etc/apt/sources.list.d/10gen.list
sudo apt-get -y update
sudo apt-get -y install mongodb-10gen
@marcusandre
marcusandre / tab.js
Last active October 10, 2015 10:57
Quickly open a link in a new tab
function openTab (url, method) {
var m = method || '_blank'
var w = window.open(url, m)
w.focus()
}
openTab('https://google.com/')
@marcusandre
marcusandre / get-cb.js
Created November 9, 2015 20:52
get last argument from arguments list if it is a function
function dummy () {
var args = [].slice.call(arguments)
var fn = typeof args[args.length - 1] === 'function' ? args.pop() : null
// ...
}
@marcusandre
marcusandre / inline-blocks.md
Created February 26, 2015 21:47
Correct inline-block elements
<div style="text-align: center;">
  <div class="inline-block">Element</div>
  <div class="inline-block">Element</div>
  <div class="inline-block">Element</div>
</div>
.inline-block {

Project

Description: What does this project do and who does it serve?

Project Setup

How do I, as a developer, start working on the project?

  1. What dependencies does it have (where are they expressed) and how do I install them?
  2. How can I see the project working before I change anything?
@marcusandre
marcusandre / Makefile
Created January 14, 2013 20:48
Mocha setup
TESTS = $(shell find test -name "*.js")
test:
@NODE_ENV=test mocha \
$(TESTS)
.PHONY: test
@marcusandre
marcusandre / slugify.js
Last active December 14, 2015 06:09
Generate a slug with JavaScript.
// sync example.
function createSlug(title) {
return title
.toLowerCase()
.replace(/[^\w ]+/g,'')
.replace(/ +/g,'-');
}
var slug = createSlug('This is a test!');
console.log(slug);