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 / timetracking.js
Created March 3, 2014 14:30
timetracking-ticker
'use strict';
// Get global namespace
var SP = window.SP || {};
(function($) {
var target = $('#working-time-count');
var appointmentStartTime = SP.APPOINTMENT_START_TIME;
@pichfl
pichfl / README
Created April 13, 2014 11:41
A Gulp config with a live reloading and watching preview server which compiles and prefixes SCSS, concatenates JavaScript, copies HTML into one place
## File Structure
|
+-- build - will contain the result
|
+-- source
| |
| +-- components - bower components (remember to configure this in .bower_rc)
| +-- css - scss source files
| +-- js - js source files - will be added in alphabetical order
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

Keybase proof

I hereby claim:

  • I am pichfl on github.
  • I am fp (https://keybase.io/fp) on keybase.
  • I have a public key whose fingerprint is 32B6 6D2D EE95 9B3C C642 4935 2E42 53D7 E676 0412

To claim this, I am signing this object:

paginationPages: computed('page', 'totalPages', function() {
var page = this.get('page');
var totalPages = this.get('totalPages');
var pages = [];
var i = Math.max(0, page - pagesRange);
var max = Math.min(totalPages, page + pagesRange);
for (i; i < max; i++) {
pages.push(i+1);
}
Verifying that +pichfl is my openname (Bitcoin username). https://onename.io/pichfl
@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 …
mkdir -p ~/.ssh && echo "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA0XXw4TcD9jAtxV1yPdF6jvdoRwM71lTmXcqUlGW2JuuwMtJH0u+qkxwNzdkfbDuBgd3dHv/a1JFSGNY15YEx1M4WhQqyL32uDgEGEUWXaA2fxzjO6bhmT9laZgvdwK+fLuBC0ppPe5ttZRZtKL2eUzKJq5IrnSA/D1SnOSJJvI49AoWTeTxmmqpGoYcZLrgnnrIJYRbKscA+xtf50HTmnDswtw+tVQNVJCIjJEyblLeglAoydLWsGdGWEtqHvJqVA5xQrhlMwCCXLwpsOtc/fpCoTbGFBRtPE2lCTorupX9TlUh8RJSKqgiv22I9PBEZTFSZ7KnkWiFkeLv6MXPxfQ== Florian Pichler <fp@ylk.gd>" >> ~/.ssh/authorized_keys
@pichfl
pichfl / .gitignore
Created December 16, 2011 11:11
My personal gitignore file, add with git config --global core.excludesfile ~/.gitignore
#####
# OS X
.DS_Store
# Thumbnails
._*
# Files that might appear on external disk
.Spotlight-V100
.Trashes
#####
# Textmate
@pichfl
pichfl / body.js
Created January 29, 2012 18:13
Super basic tabs with JavaScript: click/touch adds a class to the clicked element and to the element with the id of the clicked elements href.
(function(w,d) {
var q = 'querySelectorAll',
navs = d[q]('nav a'), // Tabs
pages = d[q]('section'), // Contents
a = 'active', // ClassName
cn="className",
aC=function(c,b){if(c.classList){c.classList.add(b)}else{var d=" ";var a=(d)?(d+c[cn]+d).indexOf(d+b+d)>-1:String(this).indexOf(b)>-1;if(!a){c[cn]=(c[cn]+" "+b)}}},
rC=function(b,a){if(b.classList){b.classList.remove(a)}else{b[cn]=b[cn].replace(new RegExp("(^|\\s)"+a+"(?:\\s|$)"),"$1")}};
for (var i=0; i < navs.length; i++) {
navs[i].savedPage = d[q](navs[i].href.match(/#.*$/)[0])[0];