Skip to content

Instantly share code, notes, and snippets.

View jipiboily's full-sized avatar

JP Boily jipiboily

  • Alma, Quebec, Canada
View GitHub Profile
@groveriffic
groveriffic / mathlink.rb
Created August 31, 2012 03:33
jruby-mathlink
@hinke
hinke / gist:3823496
Created October 2, 2012 21:43
Fetch headers from build image and do something
get '/travis/:id/status' do |id|
token = "token!!"
http = Net::HTTP.new('magnum.travis-ci.com', 443)
http.use_ssl = true
path = "/Readmill/#{id}.png?token=#{token}"
response = http.head(path, nil)
if response['Content-Disposition'].include?('failing')
@message = "The build failed."
@remi
remi / example.rb
Created December 6, 2012 18:38
Gathering options using a block
# config/initializers/tumbz_init.rb
Tumbz.configure do |config|
config.access_key = "foo"
config.access_secret = "bar"
end
# lib/tumbz.rb
module Tumbz
def self.configure
@options = OpenStruct.new
#!/bin/bash
git checkout master
git pull
git branch --remotes --merged | grep origin > .master_merged
git checkout release-staging
git pull
git branch --remotes --merged | grep origin > .staging_merged
diff .master_merged .staging_merged
rm .master_merged .staging_merged
@petehamilton
petehamilton / README.md
Last active July 8, 2021 09:50
Circle CI Build Status widget for Dashing (Single Builds)

Description

Dashing widget to show the build status of a CircleCI project.

Usage

  • Get a Circle API Token from your Account Dashboard and set it in your environment as CIRCLE_CI_AUTH_TOKEN
  • Add the httparty to your Gemfile and run bundle install

Then:

@wsargent
wsargent / docker_cheat.md
Last active August 31, 2023 12:10
Docker cheat sheet
@Supro
Supro / active_model_serializers_rspec.rb
Last active December 26, 2015 11:09
ActiveModelSerializers example
### spec/serializers/building_spec.rb
require "spec_helper"
describe BuildingSerializer do
include Rails.application.routes.url_helpers
let(:room) { create :room }
let(:building) { room.building }
let(:hash) { BuildingSerializer.new(building).serializable_hash }
@mperham
mperham / gist:5f492a2233ed44d1bb2b
Last active April 16, 2024 12:31
Golang high-level crypto APIs

Go has a number of low-level crypto APIs which check off marketing bullet-points (got FIPS supprt, check!) but is missing an high-level API usable by mere mortal programmers. Imagine you want to create a document, sign it and verify that document later. Now check out Go's crypto APIs and give up in frustration after an hour of Googling.

The API should encapsulate a half-dozen common operations and make them as easy as possible. Avoid choice where possible, just pick something reasonably secure in 2014 for me and use it! I'm speaking specifically of a few basic actions (yes, this API is very naive/non-idiomatic), call it crypto/easy:

  • Create me a public/private key pair and save it to the filesystem.
// create and persist a keypair to the current directory.
// this is just a one-time operation, now we have a keypair to use.
easy.CreateKeyPair()