Skip to content

Instantly share code, notes, and snippets.

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

Alexander ADAM alexanderadam

⌨️
⌨️
View GitHub Profile
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@andrewpcone
andrewpcone / recurive_symbolize.rb
Created April 28, 2014 01:36
Recursively symbolize_keys in a nested ruby hash
require 'active_support/core_ext/hash'
def symbolize_keys!(thing)
case thing
when Array
thing.each{|v| symbolize_keys!(v)}
when Hash
thing.symbolize_keys!
thing.values.each{|v| symbolize_keys!(v)}
end
#!/usr/bin/env ruby
require 'pp'
require 'spotify'
require 'io/console'
USERNAME='tliff'
PLAYLIST='spotify:user:1121758979:playlist:1ohNJvub3eoB86tKumCC7U'
CONFIG = Spotify::SessionConfig.new({
api_version: Spotify::API_VERSION.to_i,
application_key: File.binread(File.expand_path("~/.spotify/spotify_appkey.key")),
@ericboehs
ericboehs / spotify-playlist-example.rb
Last active August 29, 2015 14:02
Example ruby script to retrieve users playlists (including starred)
#!/usr/bin/env ruby
# encoding: utf-8
# Gemfile:
# source "https://rubygems.org"
#
# gem 'spotify'
# gem 'pry'
require "bundler/setup"
@headius
headius / changelog output
Created October 31, 2014 20:57
bash function to generate a ruby-core changelog entry from most recent git commit
~/projects/ruby $ changelog
Fri Oct 31 15:56:46 2014 Charles Oliver Nutter <headius@headius.com>
* object.c: Make a meaningless change to test changelog script.
Origin: Vagrant mirror repo
Label: Same
Codename: deb
Architectures: i386 amd64
Components: main
Description: Apt repository for project vagrant
#SignWith: 5269DE62
anonymous
anonymous / index.html
Created September 22, 2015 20:04
JS Bin // source http://jsbin.com/junovimumo
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body>
<script id="jsbin-javascript">
'use strict';
@Overbryd
Overbryd / download.rb
Created January 28, 2012 19:33
A very fast spaghetti-script written in Ruby that downloads files
#!/usr/bin/env ruby
# download (Works for me™)
#
# A simple & fast download script that utilizes em-http-request as http client
# Usage: download <url>
#
# The filename is determined either by the GET path or by the Content-Disposition response header if given.
# The script will check if there is an existing file and try to resume the download if possible.
#
# Sometimes writing Spaghetti code can be a lot of fun. Don't use it, I do not want to maintain this script.
@kylefritz
kylefritz / squeezebox.coffee
Last active October 23, 2015 14:38
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
@Su-Shee
Su-Shee / gist:285ceeaf126add1e9a11
Last active October 25, 2015 16:47
Falsehoods programmers cannot believe about non-existing things
There is a huge body of valid and yet faked or non-existing things you can use freely e.g. for testing purposes:
* The "Null Island" being a geographical convenience, non-existing island: "Null Island is a fictional island in the Gulf of Guinea
added to the Natural Earth public domain map dataset, located where the equator crosses the prime meridian, at coordinates 0°N 0°E."
see details: https://en.m.wikipedia.org/wiki/Null_Island - it even has a fake travel website :)
http://www.nullisland.com/travel.html
* On TV, you see the recurring fake phone number: https://en.wikipedia.org/wiki/Fictitious_telephone_number