Skip to content

Instantly share code, notes, and snippets.

View simbo's full-sized avatar
:octocat:

Simon Lepel simbo

:octocat:
View GitHub Profile
@simbo
simbo / captains.json
Created October 24, 2017 00:27
Captains Data Mock
[
{
"id": "6137138c-6322-4285-9aa2-76cd787e02b3",
"firstname": "James",
"middlename": "Tiberius",
"lastname": "Kirk"
},
{
"id": "055ae2b5-2ac5-4841-963e-2e8d9d8ffb40",
"firstname": "Jean-Luc",
'use strict';
var path = require('path');
var autoprefixer = require('autoprefixer'),
csswring = require('csswring'),
glob = require('glob'),
lost = require('lost'),
mqpacker = require('css-mqpacker');
@simbo
simbo / responsive-images-solution.md
Last active November 22, 2017 05:35
Responsive images solution

Responsive Images Solution

When uploading an image via the cms, multiple versions should be generated using defined ratios and sizes.

To use a specific image source in the frontend, a key like 2_1_1920 is used, which would in this case deliver a version of the image with a ratio of 2:1 and a width of 1920px.

Here's an example of an image, that should keep the ratio 2:1 in all viewports. Within the <picture> element there are 4 <source> elements and 1 <img> element as fallback.

@simbo
simbo / simbo.ninja-user-examples.js
Last active March 28, 2016 23:40
Examples for interacting with User class in project simbo.ninja
var Q = require('q');
var User = require('app/modules/user');
// create a new user
Q(new User())
.then(User.q.setUsername('foo'))
.then(User.q.setPassword('1234567890'))
.then(User.q.save())
/**
* Content spacing
* =============================================================================
*/
$content-spacing_first-level
margin-top: content-spacing.first-level
margin-bottom: content-spacing.first-level
$content-spacing_second-level
@simbo
simbo / nvm-sync-global-packages.sh
Last active November 12, 2015 12:55
sync globally installed packages of two node versions installed via nvm
#!/bin/bash
#
# nvm-sync-global-packages (nsgp)
source ~/.nvm/nvm.sh
function change_node_version() {
nvm use $1 &> /dev/null
}
'use strict';
var values = ['A', 'B', 'C', 'D'];
function getCombinations(parts) {
var mix = function(rest) {
return rest.length === 0 ? '' : rest.join('');
};
var combine = function(combinations, firstPart, i, _parts) {
var rest = _parts.filter(function(part) {
@simbo
simbo / use-github-project-subfolder-as-github-project-page.md
Created October 5, 2015 22:00
Use GitHub project subfolder as GitHub pages project page

Create an empty branch for your github page:

git checkout --orphan gh-pages

Commit at least one file to this branch and push it to GitHub.

Switch to your master branch.

'use strict';
var autoPlug = require('auto-plug'),
glob = require('glob'),
path = require('path');
function Plug() {
this.dir = path.join(path.dirname(module.parent.filename), '.gulpplug');
this.tasksDir = path.join(this.dir, 'tasks');
this.taskGlob = '**/*.js';
@simbo
simbo / setup-sublimelinter.md
Created August 3, 2015 13:53
Setup SublimeLinter with Linters for Javascript and Stylus