Skip to content

Instantly share code, notes, and snippets.

View pichfl's full-sized avatar
👨‍🎨
No mistakes, only happy accidents.

Florian Pichler pichfl

👨‍🎨
No mistakes, only happy accidents.
View GitHub Profile
@pichfl
pichfl / components.a-button.js
Last active April 27, 2017 11:06
Button Interaction inside translation
import Ember from 'ember';
var htmlEscapes = [
{
char: /&/gim,
repl: '&',
},
{
char: /</gim,
repl: '&lt;',
import Ember from 'ember';
export default Ember.Component.extend({
tagName: 'button',
result: 0,
click() {
this.set('result', Math.random());
const result = this.get('result');
@pichfl
pichfl / Usage.hbs
Last active December 14, 2016 13:57
In need for snow in your ember app?
{{!-- Fullscreen --}}
{{x-snow fullscreen=true}}
{{!-- Fixed size --}}
{{x-snow width=1000 height=200}}
module.exports = {
root: true,
parser: 'babel-eslint',
parserOptions: {
ecmaVersion: 6,
sourceType: 'module'
},
extends: 'airbnb-base',
env: {
'node': true
const argv = require('minimist')(process.argv.slice(2));
const readFileSync = require('fs').readFileSync;
const join = require('path').join;
const configFilePath = argv.config;
const config = JSON.parse(readFileSync(join(__dirname, '..', 'config.json')));
if (configFilePath) {
// Read config file defined by param from disk
const configFile = readFileSync(configFilePath);
// sample array
const rolling = [2, 4, 6, 8, 15];
// Returns the average of an array of numeric values
function average(arr) {
// .reduce() with a simple callback creates the sum of all values inside the array
// dividing by the length of the array to get the average
return arr.reduce((a, b) => a + b) / arr.length;
}
{
"data": {
"id": "43917710-36f0-4e41-9767-786f744fb1bd",
"type": "containeroutlet",
"attributes": {
"position": 0,
"name": "Any Layout",
"is_searchable": false,
"help_text": "Any description for any layout",
"is_array": false
mkdir -p ~/.ssh && echo "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA0XXw4TcD9jAtxV1yPdF6jvdoRwM71lTmXcqUlGW2JuuwMtJH0u+qkxwNzdkfbDuBgd3dHv/a1JFSGNY15YEx1M4WhQqyL32uDgEGEUWXaA2fxzjO6bhmT9laZgvdwK+fLuBC0ppPe5ttZRZtKL2eUzKJq5IrnSA/D1SnOSJJvI49AoWTeTxmmqpGoYcZLrgnnrIJYRbKscA+xtf50HTmnDswtw+tVQNVJCIjJEyblLeglAoydLWsGdGWEtqHvJqVA5xQrhlMwCCXLwpsOtc/fpCoTbGFBRtPE2lCTorupX9TlUh8RJSKqgiv22I9PBEZTFSZ7KnkWiFkeLv6MXPxfQ== Florian Pichler <fp@ylk.gd>" >> ~/.ssh/authorized_keys
@pichfl
pichfl / timemachinebackup.sh
Last active August 29, 2015 14:16
A small script to mount a volume, make a TimeMachine backup, wait for it to finish and unmount the volume again. Please adjust to your needs.
#!/bin/sh
# ------------------------------------------------------
# A small script to mount a volume, make a TimeMachine
# backup, wait for it to finish and unmount
# the volume again. Please adjust to your needs.
# ------------------------------------------------------
# Mount the backup volume, adjust to your needs
#diskutil mount …
@pichfl
pichfl / gulpfile.js
Created March 2, 2015 12:55
Static site generator Gulpfile with Sass, Browserify and LiveReload
'use strict';
var argv = require('minimist')(process.argv.slice(2));
var browserify = require('browserify');
var browserSync = require('browser-sync');
var buffer = require('vinyl-buffer');
var frontmatter = require('front-matter');
var gulp = require('gulp');
// var path = require('path');
var source = require('vinyl-source-stream');