Skip to content

Instantly share code, notes, and snippets.

View orlando's full-sized avatar
🦅

Orlando Del Aguila orlando

🦅
View GitHub Profile
@orlando
orlando / mac-setup.md
Last active January 27, 2024 21:18 — forked from todc/mac-setup.md
Fresh Mac OS Setup

1. Run Software Update

Make sure everything is up to date in the App Store

2. Install Homebrew

  1. Open a terminal window and execute the Homebrew install script:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
@orlando
orlando / Dockerfile
Created April 19, 2018 02:09
WordPress Docker SMTP email configuration with environment variables
FROM wordpress:latest
# Setup SMTP by running apache2-config.sh
COPY ["apache2-config.sh", "/usr/local/bin/"]
CMD ["apache2-config.sh"]
@orlando
orlando / gist:1558317
Created January 4, 2012 03:19
cheap oauth implementation
module Session
def self.generate_timestamp
Time.now.strftime("%s")
end
def self.generate_nonce
rand(36**16).to_s(36)
end
@orlando
orlando / activeadmin-cancan.rb
Created November 25, 2012 01:54
Deep integration of CanCan into ActiveAdmin
# blog post:
# Before using this initializer, you must set up Cancan. First, add the gem to your Gemfile:
#
# gem 'cancan'
#
# Next, generate and edit an Ability class:
#
# rails generate cancan:ability
#
@orlando
orlando / cheap_downloader.rb
Created January 3, 2012 16:39
destroyallsoftware cheap screencast downloader
#!/usr/bin/ruby
require 'rss'
#this assumes you have a cookies.txt with destroyallsoftware.com cookies... later ill add a signin method..
class Link
attr_accessor :link,:title,:date
def initialize(link,title,date)
@link = link
@orlando
orlando / slackNotify.js
Last active November 3, 2016 14:13
lambda sns slack notify function
var slackWebhookPath = '/services/T02N0QWAS/B2N58DH4N/lczo4THnmZvr2sNVMutCGH4P';
var https = require('https');
var util = require('util');
var colorMap = {
'ALARM': 'danger',
'OK': 'good',
'INSUFFICIENT_DATA': 'warning'
};
exports.handler = function(event, context) {
@orlando
orlando / event.js
Last active October 24, 2016 22:00
Poors man EventSupport example
class EventSupport {
constructor(props) {
this.parent = props.parent;
this.name = props.name;
this.eventQueue = {};
}
trigger(eventName, props) {
if (typeof props === 'undefined') {
@orlando
orlando / VierPagerAndroid.android.with-plugin.js
Last active August 30, 2016 21:37
ViewPagerAndroid.android.js babel issue
var ViewPagerAndroid = function (_React$Component) {
babelHelpers.inherits(ViewPagerAndroid, _React$Component);
function ViewPagerAndroid() {
var _ref;
var _temp, _this, _ret;
babelHelpers.classCallCheck(this, ViewPagerAndroid);
@orlando
orlando / jquery_ujs_safari_workaround.js
Last active July 25, 2016 04:16
Rails jquery-ujs Safari UI locking workaround
// Safari blocks the UI as soon as a form is submitted
// This behaviour prevents us from doing animations inside buttons
// This is a workaround to give the render engine some time before blocking
// This depends on jQuery browser to know if the current browser is Safari
// We happened to have that dependency when I implemeneted this workaround
$(function () {
if (!$.browser.safari) {
return;
@orlando
orlando / .drone.yml
Created July 11, 2016 17:26
Drone.yml Node.js
build:
image: node:5-wheezy
commands:
- npm install --silent
- npm test
cache:
mount:
- .git
- node_modules