Skip to content

Instantly share code, notes, and snippets.

View maveonair's full-sized avatar
👨‍💻

Fabian Mettler maveonair

👨‍💻
View GitHub Profile
@maveonair
maveonair / gist:11db8885fb63dbc4dc1c649de6469155
Created November 23, 2016 15:21
Use ngrok with aspnet iisexpress
ngrok http -host-header=rewrite localhost:5219
@maveonair
maveonair / docker-commands.md
Last active July 28, 2016 08:06
Useful docker commands

Remove dangling docker images

docker rmi $(docker images -f "dangling=true" -q)
@maveonair
maveonair / gist:6420652
Created September 3, 2013 07:21
Sometimes it is not possible to add the pry-rails gem to a rails project. For this reason a starting the rails console with pry and execute the following ruby code:
# start rails console first:
# bundle exec pry -r ./config/environment
require rails
require 'rails/console/app'
require 'rails/console/helpers'
extend Rails::ConsoleMethods
ActiveRecord::Base.logger = Logger.new(STDOUT)
@maveonair
maveonair / pdf_export.rb
Last active December 21, 2015 08:28
Prawn PDF Export with page break for bounding_box
class PdfExport < Prawn::Document
def to_pdf
build_pdf
render
end
def build_pdf
add_page_break_if_overflow do
bounding_box([155, cursor - 25], :width => 330) do
# Put some PDF text here...
@maveonair
maveonair / xvfb
Last active December 19, 2015 19:38 — forked from rsanheim/xvfb
chown user /etc/init.d/xvfb
chmod +x /etc/init.d/xvfb
import com.google.gson.Gson;
import com.google.gson.JsonSyntaxException;
import com.android.volley.AuthFailureError;
import com.android.volley.NetworkResponse;
import com.android.volley.ParseError;
import com.android.volley.Request;
import com.android.volley.Response;
import com.android.volley.Response.ErrorListener;
import com.android.volley.Response.Listener;
@maveonair
maveonair / create_fixture.rb
Created June 30, 2013 19:41
Rails: load/create fixtures via the Rails console
require 'active_record/fixtures'
ActiveRecord::Fixtures.create_fixtures("#{Rails.root}/test/fixtures", "fixture")
@maveonair
maveonair / install_ruby_rbenv.sh
Last active December 18, 2015 03:39 — forked from thomaswitt/install_ruby_rbenv_sh
Installing Ruby with umlaut support when using Rbenv
#!/bin/sh
if [[ -z "$1" ]]; then
echo "No Ruby version was specified."
echo "example: install_ruby_rbenv.sh 1.9.3-p429"
exit 1
fi
RUBY_VERSION=$1
###Use this for global readline for later reuse
# http://wiki.apache.org/solr/FAQ#How_can_I_delete_all_documents_from_my_index.3F
# http://wiki.apache.org/solr/UpdateXmlMessages#Updating_a_Data_Record_via_curl
curl http://localhost:8983/solr/collection1/update -H "Content-Type: text/xml" --data-binary '<delete><query>*:*</query></delete>'
# Commit the update
curl http://localhost:8983/solr/collection1/update?commit=true
/*
JSTN THEME FOR LIMECHAT 1.0
put this and the other thing in ~/Library/Application Support/LimeChat/Themes/
bg 1a2230
hlight 273146
red e44347
purps 8b84d0
fuscia c2339a