Skip to content

Instantly share code, notes, and snippets.

View mindreframer's full-sized avatar
🎯
Focusing

Roman Heinrich mindreframer

🎯
Focusing
View GitHub Profile
class Zodiac
SIGNS = [
[:aries, [21,3,20,4]],
[:taurus, [21,4,20,5]],
[:gemini, [21,5,20,6]],
[:cancer, [21,6,22,7]],
[:leo, [23,7,22,8]],
[:virgo, [23,8,22,9]],
[:libra, [23,9,22,10]],
[:scorpio, [23,10,21,11]],
@mindreframer
mindreframer / after_brew_install.md
Created August 23, 2013 09:38
LauchDaemon for MongoDB on OSX Lion

sudo rm -rf /Library/LaunchDaemons/homebrew.mxcl.mongodb.plist sudo cp /usr/local/Cellar/opt/mongodb/homebrew.mxcl.mongodb.plist /Library/LaunchDaemons/homebrew.mxcl.mongodb.plist sudo launchctl load /Library/LaunchDaemons/homebrew.mxcl.mongodb.plist sudo launchctl start homebrew.mxcl.mongodb

@mindreframer
mindreframer / gist:5730042
Created June 7, 2013 15:20
Read your contacts from gmail with ruby
# gem install contacts
# >> remove "require 'jcode' " in gdata gem, if on ruby 1.9
require 'rubygems'
require 'contacts'
CONTACTS_SCOPE = 'http://www.google.com/m8/feeds/'
CONTACTS_FEED = CONTACTS_SCOPE + 'contacts/default/full/?max-results=1000'
@client = GData::Client::Contacts.new
@mindreframer
mindreframer / fast_copy_big_data.txt
Last active April 21, 2016 05:59
copy big data amounts quickly from remote machines
### install qpress from here: http://www.quicklz.com/
# wget http://www.quicklz.com/qpress-11-linux-x64.tar
# tar xvf qpress-11-linux-x64.tar
## switch nc to traditional on ubuntu:
>sudo update-alternatives --config nc
There are 2 choices for the alternative nc (providing /bin/nc).
Selection Path Priority Status
------------------------------------------------------------
@mindreframer
mindreframer / dw_audio_course_rss_feed_to_html.rb
Created February 11, 2013 12:40
create HTML-page from Deutsche Welle Audio Course
#!/usr/bin/env ruby
# encoding: UTF-8
require 'rubygems'
require 'nokogiri'
require 'open-uri'
url = "http://rss.dw.de/xml/DKpodcast_audiotrainer_de"
filename = "DKpodcast_audiotrainer_de"
unless File.exists?(filename)
`wget #{url}`
@mindreframer
mindreframer / twitter_friends_with_caching.rb
Last active December 12, 2015 02:48
filter your twitter friends
#!/usr/bin/env ruby
require 'twitter'
require 'dbm'
# https://dev.twitter.com/apps
# https://dev.twitter.com/apps/{some_id}/show -> (OAuth settings + Your access token)
CONSUMER_KEY = "_"
CONSUMER_SECRET = "_"
OAUTH_TOKEN = "_"
@mindreframer
mindreframer / s3-downloader.rb
Created January 17, 2013 00:21
S3 downloader (signed URL)
# encoding : utf-8
#!/usr/bin/env ruby
require 'openssl'
require 'digest/sha1'
require 'base64'
require 'date'
require 'uri'
class S3; end
class << S3
@mindreframer
mindreframer / after_fix.txt
Last active December 11, 2015 05:19
fixing ActiveAttr::Typecasting#typecaster_for to be more nice... ))) before: 25 19.8% 19.8% 25 19.8% ActiveAttr::Typecasting#typecaster_for (20% of code in typecaster...) after: ... just not there! :)
Total: 96 samples
14 14.9% 14.9% 15 16.0% Kernel#require_without_backports
12 12.8% 27.7% 12 12.8% garbage_collector
10 10.6% 38.3% 10 10.6% Hash#[]=
7 7.4% 45.7% 42 44.7% Kernel#gem_original_require
6 6.4% 52.1% 6 6.4% File.file?
5 5.3% 57.4% 5 5.3% File.read
4 4.3% 61.7% 4 4.3% Hash.[]
4 4.3% 66.0% 4 4.3% Module#module_eval
3 3.2% 69.1% 5 5.3% Module#defentity

HTML Building:

  • Forms:
  • Forme: Great simple form building
  • HTML
  • Tiny: Framework agnostic markup builder, useful for defining view helpers or as a micro templating dsl, plays nice with erb and haml (Examples: http://forme.heroku.com/)