Skip to content

Instantly share code, notes, and snippets.

@vemek
vemek / components.inner-panel.js
Created June 22, 2017 12:54
panel-contextual-components
import Ember from 'ember';
export default Ember.Component.extend({
isOpen: Ember.computed('openPanels', function() {
return this.get('openPanels').includes(this.get('name'));
})
});
@vemek
vemek / mailgun_api_params_to_mime.rb
Created February 22, 2016 11:02
convert raw Mailgun inbound email parameters to a valid MIME Mail document (useful for processing with spamassasin)
#!/usr/bin/env ruby
require 'json'
require 'mail'
if ARGV.count != 1
puts("Usage: #{$PROGRAM_NAME} mailgun_params.json")
exit(1)
end
mail_params = JSON.parse(File.readlines(ARGV[0]).join(''))

Keybase proof

I hereby claim:

  • I am vemek on github.
  • I am vemek (https://keybase.io/vemek) on keybase.
  • I have a public key whose fingerprint is 53BF C771 60B5 64F0 F721 008F B0CF D8B3 4733 AC75

To claim this, I am signing this object:

@vemek
vemek / check-ruby-syntax.sh
Created September 19, 2014 17:14
Run .rb files changed in the latest commit on your git branch through ruby -c
#!/bin/bash
# Run files changed in latest commit through ruby's syntax checker
# Recurses down if last commit was a merge
for file in $changed; do
if [[ "$file" == *.rb ]]; then
echo -n "Checking syntax of changed file $file: ";
if ruby -c "$file"; then
echo 'all good';
# _plugins/category_and_tag_index_generator.rb
module Jekyll
class CategoryAndTagIndexGenerator < Generator
safe true
def generate(site)
if site.layouts.key? 'category_or_tag_index'
dir = site.config['category_dir'] || 'categories'
site.categories.keys.each do |category|
@vemek
vemek / mysql-ram-linux.sh
Created May 7, 2013 10:46
Spin up a new MySQL daemon backed by a tmpfs for super IO performance when you don't care about persistent data.
#!/bin/bash
MOUNTPOINT=/tmp/mysql-tmpfs;
SIZE_MB=1024;
if [ "0$UID" -ne 0 ]; then
echo 'This script requires root privileges for mounting the tmpfs';
exit 1;
fi
@vemek
vemek / naturalscrolling
Created August 17, 2011 22:18
Toggle OS X Lion style "natural scrolling" on Linux
#!/bin/bash
# 2011 : mk429@netsoc.tcd.ie
# requires xinput
function usage {
cat <<-EOM
usage: $0 <action>
action may be: on | off | toggle
without the an action, just print status of natural scrolling and exit