Skip to content

Instantly share code, notes, and snippets.

View jantimon's full-sized avatar
🧨

Jan Nicklas jantimon

🧨
View GitHub Profile
// http://codepen.io/jantimon/pen/meNYaj
$break-small: 629px;
$break-large: 950px;
$breakpointsMinWidth: (
'mobile': null,
'tablet' : $break-small + 1,
'desktop': $break-large + 1
);
set UnixPath to POSIX path of ((path to me as text) & "::")
set Grunt to "cd \"" & UnixPath & "\"; node node_modules/grunt-cli/bin/grunt dev"
tell application "Terminal"
do script Grunt
activate
end tell
@jantimon
jantimon / plugin.js
Created May 29, 2016 08:43
Inject a file into the main compilation
module.exports.apply = function(compiler) {
var SingleEntryPlugin = require ('webpack/lib/SingleEntryPlugin');
var styleguideName = 'atrium-styleguide-core';
var styleguideEntry = 'atrium-entry.js';
var styleguideFileName = 'atrium/core.js';
// Inject entry into the main compilation
compiler.apply(new SingleEntryPlugin(
this.context,
// Approach 1
$('.demo').each((i,target) => {
var $target = $(target);
$target.height($target.height() + 10);
});
// Approach 2
var heights = $('.demo').map((i,target) => {
return $(target).height();
}).get();
[alias]
# Delete any branches that have been merged except master, development and the current branch
cleanup = !git remote prune origin && git branch --merged | egrep -v '(^\\*|master|develop)' | xargs git branch -d
const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
module.exports = {
entry: {
app: './src/app.js'
},
output: {
@jantimon
jantimon / switch-case.ts
Created July 20, 2018 10:09
Typescript Prevent Default Case
interface Box {
height: number;
width: number;
color: 'RED' | 'BLUE'
}
function logColor(box: Box) {
switch (box.color) {
case 'RED':
console.log(box, 'is red');
@jantimon
jantimon / switch-case.ts
Created July 20, 2018 10:09
Typescript Prevent Default Case
interface Box {
height: number;
width: number;
color: 'RED' | 'BLUE'
}
function logColor(box: Box) {
switch (box.color) {
case 'RED':
console.log(box, 'is red');
const viewportClassPrefix = (viewport: 'xs' | 'sm' | 'md' | 'lg') => viewport === 'xs' ? '' : ('-' + viewport);
const flexAlignment = {
col: {
direction: {
outer: (viewport: 'xs' | 'sm' | 'md' | 'lg') => `flex${viewportClassPrefix(viewport)}-column`,
inner: (viewport: 'xs' | 'sm' | 'md' | 'lg') => `flex${viewportClassPrefix(viewport)}-row`,
},
@jantimon
jantimon / index.js
Created August 13, 2018 15:35
DynamicRequire
export default function() {
return import('react-dom');
}