Skip to content

Instantly share code, notes, and snippets.

@ftf
ftf / flashfallback.scpt
Created November 16, 2011 12:25
AppleScript for a flash free Chrome with a flash fallback user
(*
(c) 2011 Fabian Franke
Licence: Creative Commons Attribution-ShareAlike 3.0
Needs multiple user feature; chrome v16 and newer
1. disable flash plugin in chrome
2. create new chrome user/profile with flash enabled
3. edit theFlashChromeUser to your new flash user
4. assign an alfred.app global hotkey (or any other comfortable way to envoke) to this script
(*
(c) 2011 Fabian Franke
Licence: Creative Commons Attribution-ShareAlike 3.0
Two variants:
with seperate flash user
1. disable flash plugin in chrome
2. create new chrome user/profile with flash enabled
3. edit theFlashChromeUser to your new flash user
@ftf
ftf / .tmux.conf
Created January 19, 2012 12:32
my .tmux.conf
# we like colours
set -g default-terminal "screen-256color"
# change activator to ctrl+z
unbind C-b
set-option -g prefix C-z
bind C-z send-prefix
# history
set -g history-limit 1000
@ftf
ftf / screencap.sh
Created April 17, 2012 19:44
make screenshot, save locally, upload, copy URL to clipboard
#!/usr/bin/env bash
# intended use as alfred extension
# if used otherwise take care of the {query} parameter string
#
# Edit paths for lefolder and
#
# at first, check if ~/Pictures/lescreenshots exists, if not create
# grabs a screenshot or takes a existing image as input
#
@ftf
ftf / .vimrc.after
Created April 17, 2012 22:08
my current .vimrc.after config file for the vim janus distribution
"Forget compatibility with Vi. Who cares.
set nocompatible
" Set encoding
set encoding=utf-8
" searching
set hlsearch
set incsearch
@ftf
ftf / optimize_octopress_media.sh
Created April 18, 2012 11:16
little script for optimizing images
#!/bin/bash
# tools needed: optipng, libjpeg for libtrans and gifsicle
MEDIAFOLDER=~/Development/octopress/source/media
MEMORYFILE=$MEDIAFOLDER/.optimized
for img in $MEDIAFOLDER/*.{png,jpg,jpeg,gif}; do
if [ `grep $img $MEMORYFILE 2>/dev/null | wc -l` -eq 0 ]; then
if [[ $img =~ \.png$ ]]; then
@ftf
ftf / gist:3162901
Created July 23, 2012 09:55 — forked from madrobby/gist:3161015
detect retina support
function isRetina(){
return (('devicePixelRatio' in window && devicePixelRatio > 1) ||
('matchMedia' in window && matchMedia("(-moz-device-pixel-ratio:1.0)").matches))
}
@ftf
ftf / everyday.sh
Last active December 15, 2015 10:49
#!/bin/bash
EV_DIRECTORY="/Users/manu/Pictures/daily"
EV_BASE=`basename $EV_DIRECTORY`
function everyday_newpics {
# go to where the deed is done
cd $EV_DIRECTORY
# echo some information about the process
@ftf
ftf / php-fcgi
Created November 15, 2013 10:13
PHP fastcgi init.d run script - clean and simple output sparkled with funky colors.
#!/sbin/runscript [15/3092]
# Copyright 1999-2009 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
GREEN="\033[0;32m"
YELLOW="\033[0;33m"
RED="\033[0;31m"
COLORRESET="\033[0m"
@ftf
ftf / emerge.zsh
Created November 19, 2013 11:24
Stop writing emerge --verbose --quiet --pretend --update --newuse --deep world every time, shortcut it with up.
if `type emerge >/dev/null 2>&1`; then
up() {
case $@ in
fixdeps)
sudo revdep-rebuild -pqi
;;
config)
sudo dispatch-conf
;;
pretend)