Skip to content

Instantly share code, notes, and snippets.

View kineticac's full-sized avatar

Arthur Chang kineticac

View GitHub Profile
@mattlima
mattlima / 01_rails_6_on_beanstalk.config
Last active February 1, 2024 19:22
Beanstalk config script for Rails 6
# Beanstalk ain't ready for Rails 6. This fix is courtesy of https://austingwalters.com/rails-6-on-elastic-beanstalk/
# Additional node 6 cleanup courtesy of https://github.com/nodesource/distributions/issues/486
commands:
00_remove_node_6_if_present:
command: "/bin/rm -rf /var/cache/yum && /usr/bin/yum remove -y nodejs && /bin/rm /etc/yum.repos.d/nodesource* && /usr/bin/yum clean all"
ignoreErrors: true
01_download_nodejs:
command: "curl --silent --location https://rpm.nodesource.com/setup_8.x | sudo bash -"
02_install_nodejs:
@soemarko
soemarko / theme.html
Created November 26, 2011 16:18
embed github gist to tumblr
<!-- Add the following lines to theme's html code right before </head> -->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min.js"></script>
<script src="http://static.tumblr.com/fpifyru/VCxlv9xwi/writecapture.js"></script>
<script src="http://static.tumblr.com/fpifyru/AKFlv9zdu/embedgist.js"></script>
<!--
Usage: just add <div class="gist">[gist URL]</div>
Example: <div class="gist">https://gist.github.com/1395926</div>
-->
@Shilo
Shilo / UIImage+Additions.h
Created October 17, 2011 07:43
A UIImage category that will replace or remove colors. This allows multiple colors to be changed on a single image, until it has alpha values.
//
// UIImage+Additions.h
// Sparrow
//
// Created by Shilo White on 10/16/11.
// Copyright 2011 Shilocity Productions. All rights reserved.
//
#define COLOR_PART_RED(color) (((color) >> 16) & 0xff)
#define COLOR_PART_GREEN(color) (((color) >> 8) & 0xff)
class MyApplication < Sinatra::Base
use Rack::Session::Cookie
use Warden::Manager do |manager|
manager.default_strategies :password
manager.failure_app = MyApplication
end
Warden::Manager.serialize_into_session{ |user| user.id }