Skip to content

Instantly share code, notes, and snippets.

View benaskins's full-sized avatar
🍑
Peachy

Ben Askins benaskins

🍑
Peachy
View GitHub Profile
@benaskins
benaskins / README.md
Last active February 14, 2018 21:51
Create overview html file for Lattice goals

Run it like this

TOKEN=your_token ruby lattice.rb

It will produce a page.html which you can then open and paste into a Google Doc or something

You can get your token by snooping on the HTML requests in Chrome dev tools. It will be as part of the authorization request header in the form "Bearer {token}".

Decades of Dance
* 1970s
* Funk -> Philly Soul -> Disco
* Reggae -> Dub
* 1980s
* Electro -> Detroit Techno -> Chicago House -> Acid House
* Italo Disco -> Hi-NRG -> PWL
* EBM -> Industrial
* 1990s (the great splintering)
* Rave -> UK Hardcore -> Jungle -> Drum and Bass -> UK Garage
@benaskins
benaskins / current.json
Created July 18, 2013 04:52
Desired roar behaviour
{
"departs_on":"2013-07-12",
"returns_on":"2013-07-19",
"_links": {
"self": {
"href": "http://localhost:3000/quotes/1"
}
}
}
@benaskins
benaskins / magic8ball.rb
Created July 17, 2013 09:31
Magic Eight Ball Hash
ANSWERS = {
:positive =>
[
"It is certain",
"It is decidedly so",
"Without a doubt",
"Yes definitely",
"You may rely on it",
"As I see it yes",
"Most likely",
ra365](master) gitstatus
zsh: command not found: gitstatus
[ra365](master) git stus
git: 'stus' is not a git command. See 'git --help'.
Did you mean this?
status
[ra365](master) gs
# On branch master
nothing to commit (working directory clean)
1.9.3p125 :001 > [1,2,3,4,5,6,7,8].map { |n| n if n %2 == 0 }
=> [nil, 2, nil, 4, nil, 6, nil, 8]
1.9.3p125 :002 > [1,2,3,4,5,6,7,8].select { |n| n %2 == 0 }
=> [2, 4, 6, 8]
#!/bin/sh
bundle exec rake ci:$1
if [ $? -eq 0 ]
then
bundle exec rake ci:ping_campfire BUILD_TASK=$1 BUILD_STATUS=successful --trace
echo "Success"
exit 0
else
# Use https://github.com/binarylogic/settingslogic to load application configuration from config/settings.yml.
# If the file isn't present we assume we're in the production environment and attempt to load the configuration
# from environment variables.
#
# Settings can only be one deep, and the convention is that the uppercase representation of the setting
# key will be the env variable name.
#
# e.g. The following yaml:
#
# twitter_username: compliance_hound
Learning VIM
:buffers - shows open buffers
:b <n> - switch to numbered buffer
:bd - close buffer
:o <file> - open file name
:o . - open dir, shows directory listing
:bn - next buffer
:bp - previous buffer
:split - split screen
task :cache => :environment do
hydra = Typhoeus::Hydra.hydra
Site.all.each do |site|
fork do
Locality.each_url(site.webservice_connection) do |url|
req = # build request
hydra.queue
end
end
end