Skip to content

Instantly share code, notes, and snippets.

View trekdemo's full-sized avatar

Gergő Sulymosi trekdemo

View GitHub Profile
@trekdemo
trekdemo / create_post.rb
Created March 21, 2020 11:18 — forked from CrowdHailer/create_post.rb
Enforcing an interface in Ruby
class CreatePost
# An interactor to create a post.
# Initialize with a request object that implements the request interface for this interactor.
def initialize(request)
RequestInterface.required_on! request
@user = {:title => request.title}
end
def result
@trekdemo
trekdemo / clojure-dojo.md
Last active November 29, 2015 13:19 — forked from skuro/clojure-dojo.md
Crime at Piccadilly Circus

Results of the Clojure Dojo

This gist is just a placeholder for your solution of the Clojure Dojo from the Amsterdam Clojurians meetup.

To share your solution:

  • fork this gist
  • add the files containing your code to the forked gist

Thanks!

echo "deb http://apt.postgresql.org/pub/repos/apt/ precise-pgdg main" | sudo tee /etc/apt/sources.list.d/pgdg.list
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ precise-pgdg main" >> /etc/apt/sources.list'
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
wget --quiet -O - http://apt.postgresql.org/pub/repos/apt/ACCC4CF8.asc | sudo apt-key add -
sudo apt-get update
sudo apt-get install postgresql-9.3 postgresql-server-dev-9.3 postgresql-contrib-9.3 -y
sudo apt-get install postgresql-9.3-postgis pgadmin3 postgresql-contrib -y
sudo su - postgres -c "psql template1 -p 5433 -c 'CREATE EXTENSION IF NOT EXISTS hstore;'"
@trekdemo
trekdemo / commitdiff.sh
Created May 2, 2012 11:04 — forked from major/commitdiff.sh
Differences in commits between two branches (on rackerhacker.com)
MASTER=`git log --pretty=format:'%H' master | sort`
DEV=`git log --pretty=format:'%H' development | sort`
for i in `diff <(echo "${MASTER}") <(echo "${DEV}") | grep '^>' | sed 's/^> //'`;
do
git --no-pager log -1 --oneline $i;
done
@trekdemo
trekdemo / flash_player.rb
Created February 3, 2012 14:00 — forked from rjungemann/flash_player.rb
FlexSDK Homebrew formula. Installs mxmlc and other tools.
require 'formula'
class FlashPlayer < Formula
url 'http://fpdownload.macromedia.com/pub/flashplayer/updaters/11/flashplayer_11_sa_debug.app.zip'
md5 '2770acd6997bfd5016dd51acfb20c025'
homepage 'http://adobe.com'
version '11.1'
def install
name = 'Flash Player Debugger.app'
@trekdemo
trekdemo / devise.hu.yml
Created October 17, 2011 11:16 — forked from czettnersandor/devise.hu.yml
Hungarian translation for Devise
# Additional translations at http://github.com/plataformatec/devise/wiki/I18n
hu:
errors:
messages:
expired: "lejárt, igényelj egy újat"
not_found: "nem található"
already_confirmed: "már meg van erősítve"
not_locked: "nincs zárolva"
not_saved:
helper_method :grand_parent, :parent, :resource
def grand_parent
end
def parent
@parent = params ....
end
@trekdemo
trekdemo / stay_standalone.js
Created June 23, 2011 07:13 — forked from kylebarrow/example.html
Prevent links in standalone web apps opening Mobile Safari
// Mobile Safari in standalone mode
if(("standalone" in window.navigator) && window.navigator.standalone){
window.addEventListener("load",function() {
var links = document.getElementsByTagName('a'),
i = link.length - 1;
for ( ;i; i--)
{