Skip to content

Instantly share code, notes, and snippets.

View alexanderadam's full-sized avatar
⌨️
⌨️

Alexander ADAM alexanderadam

⌨️
⌨️
View GitHub Profile
@alexanderadam
alexanderadam / Rakefile.rb
Created February 12, 2016 16:56 — forked from nimf/Rakefile.rb
I found this in the answer by Jason to this question http://stackoverflow.com/questions/19206764/how-can-i-load-activerecord-database-tasks-on-a-ruby-project-outside-rails. This is a Rakefile for using ActiveRecord without Rails. It loads ActiveRecord's databases.rake file making ActiveRecord rake tasks available for your non-rails app.
require 'bundler/setup'
require 'active_record'
include ActiveRecord::Tasks
class Seeder
def initialize(seed_file)
@seed_file = seed_file
end
require 'spotify'
track_link = 'https://play.spotify.com/track/7c0NJuLBfMRPpVuna4Offb'
album_link = 'https://play.spotify.com/album/7impFt5ybQPaautK43RyJa'
module SpotifyTest
module_function
def session
application_key = File.binread(File.join File.dirname(__FILE__), 'spotify_appkey.key')
@alexanderadam
alexanderadam / REAME.md
Created December 3, 2015 11:38 — forked from romansklenar/REAME.md
How to set up your VPS with Chef Solo

How to set up your VPS with Chef Solo

1. What is it?

There are many different provisioning tools out there, the most popular of which are Chef and Puppet. Chef uses Ruby, Puppet uses a DSL (Domain Specific Language), there are others that use simple bash too, but today we're going to focus on Chef Solo.

2. Dependencies

To get Chef working properly on your local machine you need a few things.

Make sure you use Ruby 1.9.x and not Ruby 2.x as you will get errors with the json 1.6.1 gem on 2.x. Use rbenv or RVM to manage several different Rubies on the one machine.

@alexanderadam
alexanderadam / squeezebox.coffee
Created October 23, 2015 13:30 — forked from kylefritz/squeezebox.coffee
Control Squeezebox Through Hubot [Must be a firmware version pre "UE Smart Radio"; e.g. must work with http://www.mysqueezebox.com]
# Description:
# Allows Hubot to control pandora on a squeezebox music player.
# Also plays a generic internet radio station via play.
#
# Dependencies:
# none
#
# Configuration:
# SQUEEZE_BOX_EMAIL (for mysqueezebox.com)
# SQUEEZE_BOX_PASSWORD
@alexanderadam
alexanderadam / dabblet.css
Created October 18, 2015 22:55 — forked from LeaVerou/dabblet.css
YouTubesque morphing button
/**
* YouTubesque morphing button
* Requires clip-path with CSS Shapes support, not just url()
* http://caniuse.com/#feat=css-clip-path
*/
@keyframes play { to {
-webkit-clip-path: polygon(0 0, 100% 50%, 100% 50%, 0 100%);
clip-path: polygon(0 0, 100% 50%, 100% 50%, 0 100%);
/* it should be 50% 100% (one value), but Chrome & Safari are buggy (in different ways), hence the 51 & the duplication */