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 / 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');
Verifying that +pichfl is my openname (Bitcoin username). https://onename.io/pichfl
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);
}

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:

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@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
@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 / pichfl.zshtheme
Last active December 20, 2015 01:19
My personal zsh theme for oh my zsh
# This theme is a small multiline modification of the fantastic robbyrussell.zsh-theme.
# Fix rendering errors when using multibyte characters
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
prompt_context() {
local user=`whoami`
if [[ -n "$SSH_CLIENT" ]]; then
echo "%{$fg_bold[blue]%}%n$fg_bold[red]%}@%m%{$reset_color%}"
@pichfl
pichfl / .zshrc
Last active February 5, 2018 12:27
My zsh config
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
# Oh My ZSH Configuration
ZSH=$HOME/.oh-my-zsh
ZSH_THEME="pichfl"
# CASE_SENSITIVE="true"
# DISABLE_AUTO_UPDATE="true"
# export UPDATE_ZSH_DAYS=13
@pichfl
pichfl / gist:4275655
Created December 13, 2012 10:45
Softlight calculation
CGFloat calculateSoftlight(CGFloat a, CGFloat b) {
// via http://en.wikipedia.org/wiki/Blend_modes#Soft_Light
CGFloat f;
if ( b <= 0.5 ) {
f = a - (1 - 2 * b) * a * (1 - a);
} else {
CGFloat g;
if (a <= 0.25) {