Skip to content

Instantly share code, notes, and snippets.

View coorasse's full-sized avatar
❤️
I will react...but slowly

Alessandro Rodi coorasse

❤️
I will react...but slowly
View GitHub Profile
@coorasse
coorasse / eager_loading.rb
Last active February 10, 2023 02:16
Eager loading of association with parameter in Rails
begin
require 'bundler/inline'
rescue LoadError => e
warn 'Bundler version 1.10 or later is required. Please update your Bundler'
raise e
end
gemfile(true) do
source 'https://rubygems.org'
gem 'rails', '~> 5.2'
@rtgibbons
rtgibbons / oc
Last active February 3, 2022 23:03
Openconnect init script
#! /bin/bash
### BEGIN INIT INFO
# Provides: openconnect
# Required-Start: $local_fs $remote_fs $network
# Required-Stop: $local_fs $remote_fs $network
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Basic script to connect to a SSL VPN using Openconnect
### END INIT INFO
@coorasse
coorasse / main.js
Last active February 6, 2018 12:36
Bitbucket Codeship PullRequest integration script
$(function() {
var bitbucket_project_name = 'YOUR BITBUCKET PROJECT_NAME LIKE coorasse/airesis';
var codeship_project_code = 'YOUR CODESHIPO PROJECT UUID CODE (look for it in the badge instructions page or general settings page)';
var regexp = new RegExp("^https://bitbucket.org/" + bitbucket_project_name + "/pull-request/","g");
if ((regexp).test(window.location.href)) {
var branch = $('dd.unabridged a').first().html();
var url = 'https://codeship.com/projects/'+codeship_project_code+'/status?branch='+branch;
var row = $('<div></div>')
var column1 = $('<dt>Codeship</dt>');
@samqiu
samqiu / railscasts.rb
Last active December 9, 2022 03:49
Download free Railscast video
#!/usr/bin/ruby
require 'rss'
# Usage
# $ ./railscasts.rb http://railscasts.com/subscriptions/YOURRAILSCASTRSS/\/
# episodes.rss
# OR
# $ ./railscasts.rb
p 'Downloading rss index'