Skip to content

Instantly share code, notes, and snippets.

View frippz's full-sized avatar
:octocat:

Fredrik Frodlund frippz

:octocat:
View GitHub Profile
@frippz
frippz / code-barf.css
Created January 15, 2015 13:49
Ugh, CSS preprocessors…!
.PWN-Module-Panel-Panel .panel-filter .filters .filter-content .filter-or .active a, .PWN-Module-Panel-Panel .panel-filter .filters .filter-content .filter-or .panel-menu .level1-mobile li .featured-links-mobile li a:hover a, .PWN-Module-Panel-Panel .panel-menu .level1-mobile li .featured-links-mobile li .panel-filter .filters .filter-content .filter-or a:hover a, .PWN-Module-Panel-Panel .panel-filter .filters .filter-content .filter-or .panel-menu .level1-mobile li .featured-links-mobile li a:focus a, .PWN-Module-Panel-Panel .panel-menu .level1-mobile li .featured-links-mobile li .panel-filter .filters .filter-content .filter-or a:focus a,
.PWN-Module-Panel-Panel .panel-filter-search-rooms .filters .filter-content .filter-or .active a,
.PWN-Module-Panel-Panel .panel-filter-search-rooms .filters .filter-content .filter-or .panel-menu .level1-mobile li .featured-links-mobile li a:hover a,
.PWN-Module-Panel-Panel .panel-menu .level1-mobile li .featured-links-mobile li .panel-filter
@frippz
frippz / .csscomb.json
Last active August 29, 2015 14:13
CSScomb config
{
"remove-empty-rulesets": true,
"always-semicolon": true,
"color-case": "lower",
"block-indent": " ",
"color-shorthand": true,
"element-case": "lower",
"eof-newline": true,
"leading-zero": true,
"quotes": "double",
@frippz
frippz / osx.sh
Created April 13, 2015 13:46
dotfiles-osx
#!/usr/bin/env bash
# ~/.osx — https://mths.be/osx
# Ask for the administrator password upfront
sudo -v
# Keep-alive: update existing `sudo` time stamp until `.osx` has finished
while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null &
@frippz
frippz / ssh.zsh
Last active October 22, 2015 11:18
ssh-agent binding in ZSH
sshagent () {
SSHAGENT=$(ps ax|grep "[s]sh-agent"| grep -cv Z)
if (( $SSHAGENT == 0 ))
then
sshupdate
else
SSHPID="$(ps -eo pid,command | awk '/ ssh-[a]gent/ {print $1}');"
SSHPID_ENV=$(awk '/Agent/ {print $NF}' $HOME/.ssh-env)
if [[ $SSHPID == $SSHPID_ENV ]]
then
@frippz
frippz / post-merge
Created October 26, 2015 15:23 — forked from sindresorhus/post-merge
git hook to run a command after `git pull` if a specified file was changed.In this example it's used to run `npm install` if package.json changed and `bower install` if `bower.json` changed.Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`.
#!/usr/bin/env bash
# MIT © Sindre Sorhus - sindresorhus.com
# git hook to run a command after `git pull` if a specified file was changed
# Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`.
changed_files="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)"
check_run() {
echo "$changed_files" | grep --quiet "$1" && eval "$2"
@frippz
frippz / bitbucket-webhook-deploy.php
Last active December 18, 2015 00:29
Bitbucket POST service script
<?php
try {
// Decode JSON data from Bitbucket
$payload = json_decode($_REQUEST['payload']);
}
catch(Exception $e) {
exit(0);
}
file_put_contents('payload.log', print_r($payload, TRUE), FILE_APPEND);
@frippz
frippz / convert2svgfont.pe
Created October 10, 2013 10:42
Convert multiple TrueType files to SVG
#!/usr/local/bin/fontforge
i=1
while ( i<$argc )
Open($argv[i])
Generate($argv[i]:r + ".svg")
i = i+1
endloop
@frippz
frippz / theme.zsh
Created February 23, 2016 13:26
ZSH prompt theme
autoload colors && colors
PROMPT='
$(_user_host)${_current_dir} $(git_prompt_info) $(_ruby_version)
▶ '
PROMPT2='%{$fg[grey]%}◀%{$reset_color%} '
RPROMPT='$(_vi_status)%{$(echotc UP 1)%}$(_git_time_since_commit) $(git_prompt_status) ${_return_status}%{$(echotc DO 1)%}'
@frippz
frippz / github-webhook-deploy.php
Last active July 29, 2016 10:10
Github webhook PHP script
<?php
try {
// Decode JSON data from Github
$payload = json_decode($_REQUEST['payload']);
}
catch(Exception $e) {
exit(0);
}
// Deploy live if push was on master branch

Keybase proof

I hereby claim:

  • I am frippz on github.
  • I am frippz (https://keybase.io/frippz) on keybase.
  • I have a public key whose fingerprint is 245A C595 B915 4DBB 4EB2 80DC 4BE1 FF81 2E2B E0D0

To claim this, I am signing this object: