Skip to content

Instantly share code, notes, and snippets.

View shkm's full-sized avatar
😵‍💫
Stumbling through life, one exception at a time.

Jamie Schembri shkm

😵‍💫
Stumbling through life, one exception at a time.
View GitHub Profile
@shkm
shkm / conosle.js
Created May 22, 2013 13:17
Brings conosle to Chrome. See http://youtu.be/MVw8N3hTfCI
conosle = console;
@shkm
shkm / gist:6165319
Created August 6, 2013 15:06
Basehold.it bookmarklet
javascript:(function(){l=document.createElement('link');l.rel='stylesheet';l.href='http://basehold.it/24';document.head.appendChild(l);})();
@shkm
shkm / gist:7008739
Created October 16, 2013 14:36
Multi-size favicon.ico with ImageMagick
convert favicon-16x16.png favicon-32x32.png favicon.ico
@shkm
shkm / _mixins.scss
Created October 21, 2013 15:24
Retina sprites. Given a normal and retina sprite map, along with the name of the sprite, this does magic things. Requires a retina mixin, such as https://gist.github.com/shkm/7085706
// Include normal and retina sprites. Requires retina mixin.
@mixin retina-sprite($map-1x, $map-2x, $sprite, $dimensions: true) {
$position-1x: sprite-position($map-1x, $sprite);
background: sprite-url($map-1x) $position-1x no-repeat;
@if $dimensions {
@include sprite-dimensions($map-1x, $sprite);
}
@include retina {
@shkm
shkm / _mixins.scss
Last active December 26, 2015 03:28
Retina mixin
@mixin retina {
@media only screen and (-webkit-min-device-pixel-ratio: 2),
only screen and (min-resolution: 192dppx) {
@content;
}
}
@shkm
shkm / active_admin.css.scss
Last active December 29, 2015 20:28
Restyle Rich to fit in with Active Admin's style.
form .cke_chrome {
display: inline-block;
width: calc(80% - 2px);
box-shadow: none;
// border color needs additional specificity as it is set on .cke_n.cke_chrome
border-color: #c9d0d6 !important;
}
.cke_chrome, .cke_inner {
@include rounded;
@shkm
shkm / raboparser.rb
Last active February 29, 2016 06:53
Quick 'n dirty Rabobank CSV export parser, parsing into a format that can easily be read by GnuCash.
#!/usr/bin/env ruby
# Parses Rabobank's CSV export into a CSV format more readable by GnuCash.
#
# To import, use the following settings:
#
# Start import on row: 2
# Separators: Semicolon
# Date format: y-m-d
# Currency format: Period
@shkm
shkm / rvm
Created October 17, 2016 06:19
RVM for fish. Taken from https://github.com/lunks/fish-nuggets/blob/master/functions/rvm.fish for easy use with fisherman.
function rvm --description='Ruby enVironment Manager'
# run RVM and capture the resulting environment
set --local env_file (mktemp -t rvm.fish.XXXXXXXXXX)
bash -c 'source ~/.rvm/scripts/rvm; rvm "$@"; status=$?; env > "$0"; exit $status' $env_file $argv
# apply rvm_* and *PATH variables from the captured environment
and eval (grep '^rvm\|^[^=]*PATH\|^GEM_HOME' $env_file | grep -v '_clr=' | sed '/^[^=]*PATH/s/:/" "/g; s/^/set -xg /; s/=/ "/; s/$/" ;/; s/(//; s/)//')
# needed under fish >= 2.2.0
and set -xg GEM_PATH (echo $GEM_PATH | sed 's/ /:/g')
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<updated>2019-08-01T00:00:00Z</updated>
<title>Example Feed</title>
<link href="http://example.org/"/>
<author>
<name>John Doe</name>
</author>
<id>urn:uuid:60a76c80-d399-11d9-b93C-0003939e0af6</id>
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<updated>2019-07-01T00:00:00Z</updated>
<title>Example Feed</title>
<link href="http://example.org/"/>
<author>
<name>John Doe</name>
</author>
<id>urn:uuid:60a76c80-d399-11d9-b93C-0003939e0af6</id>