Skip to content

Instantly share code, notes, and snippets.

@nicolasdao
nicolasdao / elasticbeanstalk_guide.md
Last active December 11, 2023 14:40
Elastic Beanstalk guide. Keywords: elastic bean beanstalk elasticbeanstalk cli eb eb
@jamtur01
jamtur01 / ladder.md
Last active April 28, 2024 20:07
Kickstarter Engineering Ladder
@j3j5
j3j5 / gist:8b3e48ccad746b90a54a
Last active November 16, 2023 15:11
Adyen Test Card Numbers
Adyen Test Card Numbers
These cards are only valid on our TEST system and they will never involve any actual transaction or transfer of funds. The TEST card numbers will not work on the Adyen LIVE Platform.
For all cards use the following expiration and CVV2/CVC2/or CID for Amex.
For all cards:
Expiration Dates CVV2 / CVC3 CID (American Express)
08/2018 OR 10/2020 737 7373
@DavidFrahm
DavidFrahm / release-android.sh
Last active February 22, 2017 12:15
Ionic build Android app for release, with option to open (in app such as HockeyApp for deploying to team)
#!/bin/bash
FINAL_BINARY_FILEPATH="platforms/android/build/outputs/apk/wakatime-android-release-signed.apk"
echo "*** Build Ionic release for Android ***"
rm $FINAL_BINARY_FILEPATH
ionic build --release android
echo "Signing APK..."
jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore ~/Dropbox/WakaTime/Build/Android/wakatime.keystore -storepass $WAKATIME_STOREPASS platforms/android/build/outputs/apk/android-release-unsigned.apk android
echo "Optimizing APK (zipalign)..."
~/Library/Android/sdk/build-tools/23.0.3/zipalign -v -f 4 platforms/android/build/outputs/apk/android-release-unsigned.apk $FINAL_BINARY_FILEPATH
# echo "Opening APK..."
@dhoelzgen
dhoelzgen / base_controller.rb
Last active October 7, 2021 16:19
CORS in Rails 4 APIs
class API::V1::BaseController < ApplicationController
skip_before_filter :verify_authenticity_token
before_filter :cors_preflight_check
after_filter :cors_set_access_control_headers
def cors_set_access_control_headers
headers['Access-Control-Allow-Origin'] = '*'
headers['Access-Control-Allow-Methods'] = 'POST, GET, PUT, DELETE, OPTIONS'
@ktmud
ktmud / gulpfile.js
Last active February 28, 2022 10:39
An example gulpfile.js with bower components and live reload support
var BatchStream = require('batch-stream2')
var gulp = require('gulp')
var coffee = require('gulp-coffee')
var uglify = require('gulp-uglify')
var cssmin = require('gulp-minify-css')
var bower = require('gulp-bower-files')
var stylus = require('gulp-stylus')
var livereload = require('gulp-livereload')
var include = require('gulp-include')
var concat = require('gulp-concat')
@linjunpop
linjunpop / deploy-rails-4-app-with-dokku-on-digital-ocean.md
Last active May 30, 2023 08:20
Deploy Rails 4 app with Dokku on DigitalOcean

Deploy Rails 4 app with Dokku on DigitalOcean

Install dokku

First create a Ubuntu 13.04 x64 droplet on DigitalOcean Control Panel

Then ssh with root account, run this in termianl:

$ wget -qO- https://raw.github.com/progrium/dokku/master/bootstrap.sh | sudo bash
@rgreenjr
rgreenjr / postgres_queries_and_commands.sql
Last active May 6, 2024 12:37
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(clock_timestamp(), query_start), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
@nazgob
nazgob / ctags.setup
Created January 6, 2012 13:44
ctags setup on mac
# you have ctags but it does not work...
$ ctags -R --exclude=.git --exclude=log *
ctags: illegal option -- R
usage: ctags [-BFadtuwvx] [-f tagsfile] file ...
#you need to get new ctags, i recommend homebrew but anything will work
$ brew install ctags
#alias ctags if you used homebrew
$ alias ctags="`brew --prefix`/bin/ctags"
@jeffreyiacono
jeffreyiacono / avatarable.rb
Created November 13, 2011 22:08
simple gravatar / avatar image module, alternative to https://gist.github.com/1339702
module Avatarable
extend ActiveSupport::Concern
GRAVATAR_IMAGE_BASE_URL = 'http://www.gravatar.com/avatar/'
GRAVATAR_IMAGE_DEFAULT_SIZE = '32'
DEFAULT_URL = 'http://your-awesome-domain.com/images/your-awesome-default-image.png'
# Avatarable assumes the class (or other module) that includes this module has an email attribute
# if the email attribute is named something other than email, use alias_attribute to map it to email
# alias_attribute :email, :your_email_attribute