Skip to content

Instantly share code, notes, and snippets.

View matiaskorhonen's full-sized avatar

Matias Korhonen matiaskorhonen

View GitHub Profile
@scottraio
scottraio / quiet_assets.rb
Created December 12, 2011 23:11
Quiet down Rails 3.1 asset pipeline logging in development
Rails.application.assets.logger = Logger.new('/dev/null')
Rails::Rack::Logger.class_eval do
def before_dispatch_with_quiet_assets(env)
before_dispatch_without_quiet_assets(env) unless env['PATH_INFO'].index("/assets/") == 0
end
alias_method_chain :before_dispatch, :quiet_assets
end
@jcasimir
jcasimir / build_developers.markdown
Created February 9, 2012 15:27
Build Developers

Build Developers

Brief

You cannot do it on your own. Whether you're buildings products or a consultancy, you need developers. You can't afford to outbid everyone else and, even if you do, another company will up the ante in six months. You can't rely on your network or universities to deliver fully ready Rails devs. Professional recruiters are no answer.

Your only real option is to build them. That's the situation LivingSocial faced, and in this session, we'll share lessons learned from the design, recruitment, and beginning months of Hungry Academy. Let's discuss:

  • Recruiting applicants
  • Evaluating aptitude
@matiaskorhonen
matiaskorhonen / repairls.sh
Last active October 11, 2015 16:48
How to repair multiple entries in “Open With” menu on OSX
# Run in terminal:
/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -kill -r -domain local -domain system -domain user

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@edwios
edwios / particle-photon-aes-encryption-demo.ino
Last active November 12, 2016 20:06 — forked from towynlin/spark-aes-encryption-demo.ino
Demo Particle (formerly Spark) Photon firmware using AES-128-CBC
#include "application.h"
#include "spark_protocol.h"
#include "tropicssl/rsa.h"
#include "tropicssl/aes.h"
void sixteenRandomBytes(unsigned char buf[16]) {
for (int i = 0; i < 16; i++) {
buf[i] = rand() & 0xff;
}
}
gem "resque", :require => "resque/server"
@dzogrim
dzogrim / MessagesAttachmentsCleanUp.sh
Last active August 8, 2019 18:46
macOS Messages App attachments clean-up (this will remove attachments from Messages App history!)
#!/bin/bash
## macOS 'Messages.app' attachments clean-up
## Main known media formats files will be moved to trash to save space
## Copyleft (C) 2018-2019 dzogrim
## dzogrim < dzogrim [@] dzogrim [.] pw >
#VERSION="1.0 (2018-04-07)" # initial
#VERSION="1.1 (2018-05-28)" # sort garbage
@mieky
mieky / ununzip.sh
Created May 9, 2013 10:25
Un-unzip a file without a root folder that spews its contents all around the place.
#!/bin/bash
# A bash-wrapped version of http://www.commandlinefu.com/commands/view/9536/un-unzip-a-file
if [ $# -eq 0 ]; then
echo "Un-unzips a file without a root folder."
echo "Usage: ununzip <filename>"
exit 1
elif [ ! -e $1 ]; then
echo "File not found: $1"
exit 1
fi
@mcansky
mcansky / gist:3434417
Created August 23, 2012 08:59
signing an aws s3 url
# encoding : utf-8
require 'openssl'
require 'digest/sha1'
require 'base64'
module Aws
extend self
def signed_url(path, expire_date)
digest = OpenSSL::Digest::Digest.new('sha1')
can_string = "GET\n\n\n#{expire_date}\n/#{S3_BUCKET}/#{path}"