Skip to content

Instantly share code, notes, and snippets.

View marcusandre's full-sized avatar

Marcus André marcusandre

View GitHub Profile
@tj
tj / config.js
Last active December 27, 2015 14:49
/**
* Module dependencies.
*/
var pkg = require('../package');
var env = process.env.NODE_ENV || 'development';
/**
* Return setting `name`.
*
/**
* POST to create a new user.
*/
exports.create = function *(){
var body = yield parse(this);
// password
var pass = body.password;
assert(pass, 400, 'password is required');
@jedwood
jedwood / sample-test-1.js
Last active July 4, 2016 23:55
API Testing Example - Part 1
describe('Authentication', function() {
it('errors if wrong basic auth', function(done) {
api.get('/blog')
.set('x-api-key', '123myapikey')
.auth('incorrect', 'credentials')
.expect(401, done)
});
it('errors if bad x-api-key header', function(done) {
@Martin1982
Martin1982 / config.xml
Created March 1, 2013 12:14
PhoneGap build config to hide the splashscreen spinner
<!-- iOS specific settings -->
<preference name="show-splash-screen-spinner" value="false" />
Date: Wed Jan 11 2017 20:23:08 GMT+0100 (CET)
1. Console Hacking 2016 (24941)
2. SpiegelMining – Reverse Engineering von Spiegel-Online (22407)
3. Fnord-Jahresrückblick (18797)
4. Shut Up and Take My Money! (16545)
5. Where in the World Is Carmen Sandiego? (12774)
6. Security Nightmares 0x11 (10648)
7. How Do I Crack Satellite and Cable Pay TV? (9553)
8. Die Sprache der Populisten (9157)
@jedwood
jedwood / sample-test-2.js
Created April 4, 2013 15:33
API Testing Example - Part 2
describe('/blog', function() {
it('returns blog posts as JSON', function(done) {
api.get('/blog')
.set('x-api-key', '123myapikey')
.auth('correct', 'credentials')
.expect(200)
.expect('Content-Type', /json/)
.end(function(err, res) {
if (err) return done(err);
@alkema
alkema / deploy.rb
Created July 9, 2011 20:01
Capistrano task for a Node.js app with github Forever and NPM.
set :application, "appname"
set :deploy_to, "/var/www"
set :scm, :git
set :repository, "git@github.com:user/app.git"
default_run_options[:pty] = true
set :user, "www-data"
set :domain, "foo.tld"
set :normalize_asset_timestamps, false
@tj
tj / stuff.md
Last active September 30, 2017 19:13
ES6 modules

Ok so http://wiki.ecmascript.org/doku.php?id=harmony:modules looks more less the same as it did last time I looked, however that document combined with https://github.com/rwaldron/tc39-notes/blob/master/es6/2014-06/jun-5-modules.md#do-we-need-the-module-foo-from-foo-import-syntax looks like we're conflating quite a few concepts (IMO... not trying to anger anyone).

Personally I'm in favour for removing module as mentioned in the gist. I would also remove re-exporting (export * from "crypto"), even if it's a nicety I can't say out I've done much re-exporting in the thousands and thousands of modules I've written, does anyone else do this often? (not sure)

Single exported value

Personally (barring weird edge-cases I'm not aware of?) I would love if we only had exporting a single or multiple value, with only one syntax for importing. For example the common use-case of exporting a single function or value:

ferret.js

@Sigmus
Sigmus / gulpfile.js
Last active November 15, 2017 11:55
gulpfile.js with browserify, reactify, watchify and gulp-notify.
var source = require('vinyl-source-stream');
var gulp = require('gulp');
var gutil = require('gulp-util');
var browserify = require('browserify');
var reactify = require('reactify');
var watchify = require('watchify');
var notify = require("gulp-notify");
var scriptsDir = './scripts';
var buildDir = './build';

Kirby + Patterns = <3

When I heard about Brad Frost's Patternlab for the first time at beyond tellerrand I was intrigued. The idea of splitting your design work for a website into simple modules or patterns isn't new and starts to become more and more of a standard. But organizing this into a very visual styleguide/patternlab seemed to make so much sense. Brad also introduced a very interesting approach with his separation of modules into categories, such as atoms, molecules and organisms.

I started porting Brad's patternlab app to Kirby, but it never really made it to something polished and it turned out for me after using it for Kirby's panel UI, that it's actually a pain in the ass to maintain such a pattern collection.

The problem of patternlab

The problem with such a styleguide or patternlab is that it exists next to the real thing. When you change something in your code base you also have to update the particular code for the pattern in patternlab. To be honest I went very quickly from being