set $req_header "";
set $resp_header "";
header_filter_by_lua_block{
local h = ngx.req.get_headers();
for k, v in pairs(h) do
ngx.var.req_header = ngx.var.req_header .. k.."="..v.." ";
If you're running a Rails app in Google App Engine's flexible environment, it takes a bit of setup to get to a rails console attached to your deployed environment. I wanted to document the steps for my own reference and also as an aid to others.
-
Open the Google App Engine -> instances section of the Google Cloud Platform (GCP) console.
-
Select the "SSH" drop-down for a running instance. (Which instance? Both of my instances are in the same cluster, and both are running Rails, so it didn't matter for me. YMMV.) You have a choice about how to connect via ssh.
-
Choose "Open in browser window" to open a web-based SSH session, which is convenient but potentially awkward.
-
Choose "View
gcloud
command" to view and copy agcloud
command that you can use from a terminal, which lets you use your favorite terminal app but may require the extra steps of installing thegcloud
command and authenticating thegcloud
command with GCP.
-
Please see the most up-to-date version of this protocol on my blog at https://darencard.net/blog/.
- Make sure
inotify-tools
is installed (https://github.com/rvoicilas/inotify-tools) - Configure git as usual
- Clone the git repository of interest from github and, if necessary, add file you want to monitor
- Allow username/password to be cached so you aren't asked everytime
# 1) Copy this template file into root application | |
# 2) Run: bundle install --no-deployment | |
GEM | |
remote: https://rubygems.org/ | |
specs: | |
PLATFORMS | |
ruby |
# VTE | |
apt-get install autoconf libglib2.0-dev gtk-doc-tools libpcre2-dev libgirepository1.0-dev gperf libvte-2.91-dev libvte-dev valac unzip | |
wget https://github.com/thestinger/vte-ng/archive/0.46.0.a.zip | |
unzip 0.46.0.a.zip | |
rm 0.46.0.a.zip | |
cd vte-ng-0.46.0.a | |
bash autogen.sh | |
make && make install | |
cd ~ | |
rm -rf vte-ng-0.46.0.a/ |
/* Foo */ | |
.hello | |
width: 10px | |
/* | |
Bar | |
*/ | |
&:after | |
height: 30px /* Baz */ |
When programming apps for Android, you usually want to test them on real Android devices. | |
This little gist describes how to do so using Ubuntu 14. | |
First, you need to download and install the Android development IDE (http://developer.android.com/sdk/index.html) and create an Android project which you want to debug. | |
Next, you need to setup the debugging mode on your Android device. Starting in Android 4.2 you need to enable the developer options first: 1) Go to settings 2) Go to About Phone 3) Tap the build number 10 times (or more, not sure ;)) and you will get the notification that you enabled it. | |
Then go to the developer settings and enable the debug mode for your phone. | |
Now you think you can just plug it into your USB mode? - Nope. |
// takes a {} object and returns a FormData object | |
var objectToFormData = function(obj, form, namespace) { | |
var fd = form || new FormData(); | |
var formKey; | |
for(var property in obj) { | |
if(obj.hasOwnProperty(property)) { | |
if(namespace) { |
#!/usr/local/bin/ruby | |
# matrix test with ruby | |
# Used Two Gems 'curses' for terminal cursor moving and 'rainbow' for coloring | |
# first run "gem install curses rainbow" | |
# then run this file | |
# Note: you can tweak parameters when initializing the object | |
# Enjoy :) | |
require "curses" | |
require 'rainbow/ext/string' |