Skip to content

Instantly share code, notes, and snippets.

View donaldpiret's full-sized avatar
:shipit:
Shippin' stuff

Donald Piret donaldpiret

:shipit:
Shippin' stuff
View GitHub Profile
@andrewodri
andrewodri / Dockerfile
Last active December 22, 2023 20:56
Connect Fargate instance to SSM Session Manager
FROM debian:10-slim
RUN apt-get update -y && \
apt-get install -y awscli curl gnupg && \
apt-key adv --fetch-keys "https://nginx.org/keys/nginx_signing.key" && \
echo "deb http://nginx.org/packages/debian buster nginx" > /etc/apt/sources.list.d/nginx.list
RUN curl --silent --show-error --location --output /tmp/amazon-ssm-agent.deb "https://s3.us-east-1.amazonaws.com/amazon-ssm-us-east-1/latest/debian_amd64/amazon-ssm-agent.deb" && \
dpkg -i /tmp/amazon-ssm-agent.deb
@jeromedalbert
jeromedalbert / .gitattributes
Last active March 3, 2024 12:18
Automatically resolve Git merge conflicts in Rails schema.rb by picking the most recent date in the conflict (now works with Rails 5 and recent versions of Git). The following files should be in your home ~ directory. Inspired by https://tbaggery.com/2010/10/24/reduce-your-rails-schema-conflicts.html
db/schema.rb merge=railsschema
@jpiper
jpiper / extents.geojson
Last active February 18, 2017 09:28
Singapore No Fly Zones
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ali1234
ali1234 / bb8.py
Created October 17, 2015 15:47
Control Sphero BB-8 from Linux.
#!/usr/bin/env python
# BB-8 Python driver by Alistair Buxton <a.j.buxton@gmail.com>
from bluepy import btle
import time
class BB8(btle.DefaultDelegate):
def __init__(self, deviceAddress):
@edvinasbartkus
edvinasbartkus / gist:0e99ea8305a20737f562
Last active May 20, 2022 11:08
Ruby puma.gem install on El Capitan / Mac Sierra
gem install puma -- --with-cppflags=-I/usr/local/opt/openssl/include --with-ldflags=-L/usr/local/opt/openssl/lib
@SabretWoW
SabretWoW / rspec_model_testing_template.rb
Last active March 7, 2024 03:56
Rails Rspec model testing skeleton & cheat sheet using rspec-rails, shoulda-matchers, shoulda-callbacks, and factory_girl_rails. Pretty much a brain dump of examples of what you can (should?) test in a model. Pick & choose what you like, and please let me know if there are any errors or new/changed features out there. Reddit comment thread: http…
# This is a skeleton for testing models including examples of validations, callbacks,
# scopes, instance & class methods, associations, and more.
# Pick and choose what you want, as all models don't NEED to be tested at this depth.
#
# I'm always eager to hear new tips & suggestions as I'm still new to testing,
# so if you have any, please share!
#
# @kyletcarlson
#
# This skeleton also assumes you're using the following gems:
@wheeyls
wheeyls / application_controller.rb
Last active May 15, 2022 07:04
A cached key-value store backend for Rails I18n. Designed to speed up translations when using a database like Redis or Mongo.
class ApplicationController < ActionController::Base
before_filter :ensure_fresh_i18n
private
def ensure_fresh_i18n
I18n.backend.ensure_freshness! I18n.locale
end
end
@jabley
jabley / convert2csv.sh
Created September 13, 2012 11:05
Scripts to help with converting an Oracle .dmp to CSV
#!/bin/sh
# script to automate the load and export to CSV of an oracle dump
# This script assumes:
# * you have the vagrant published key available locally in your .ssh directory
# * You have the Oracle VirtualBox image running locally
# ** ssh port-forwarding is configured for host port 2022 -> guess port 22.
set -e
@jrafanie
jrafanie / gist:3011499
Created June 28, 2012 13:49
ActiveRecord::Base doesn't serialize instance variables
~/Code/playground/rails-3-2-stable $ cat app/models/person.rb
class Person
attr_accessor :abc
end
~/Code/playground/rails-3-2-stable $ cat app/models/story.rb
class Story < ActiveRecord::Base
attr_accessor :abc
end
@dougo-chris
dougo-chris / everything
Created April 14, 2012 04:47
jasmine & jenkins
group :development, :test do
gem 'jasmine', '1.2.0.rc2', :git => 'https://github.com/pivotal/jasmine-gem.git', :require => false
# gem 'jasmine'
gem 'headless', :require => false
bundle install
bundle exec jasmine init
rm lib/tasks/jasmine.rake