- assets and specs can be CoffeeScript
- 3rd party JS can be placed to vendor/assets/javascripts or vendor gems
- detects gem-vendored JS via application.js require
- uses jasmine-headless-webkit to run the suite outside the browser
- this requires Qt4.7 installation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'json' | |
require 'open-uri' | |
require 'fileutils' | |
require 'net/smtp' | |
BACKUP_DIR='/home/git/github-backup' | |
USERNAME='my_username' | |
URL_REPOS="https://api.github.com/users/#{USERNAME}/repos" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Add all paths listed in ~/.path to the PATH variable | |
# ---------------------------------------------------------- | |
# first check if the file is available | |
if [ -f $HOME/.path ]; then | |
# read file line-by-line | |
for p in $(cat $HOME/.path); do | |
# check if line is a comment | |
if ! echo $p | grep -q ^[[:space:]]*\#; then | |
# check if the directory exists | |
if [ -d "$HOME/$p" ]; then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# faster repositories LMU | |
deb http://linuxmint.bio.lmu.de/debian-latest testing main contrib non-free | |
deb http://linuxmint.bio.lmu.de/debian-latest/multimedia testing main non-free | |
deb http://linuxmint.bio.lmu.de/debian-latest/security testing/updates main contrib non-free |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.awt.BorderLayout; | |
import java.awt.Canvas; | |
import java.awt.Dimension; | |
import javax.swing.JFrame; | |
import javax.swing.JPanel; | |
import org.eclipse.swt.SWT; | |
import org.eclipse.swt.awt.SWT_AWT; | |
import org.eclipse.swt.browser.Browser; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# extracts the embedded PNG data from .skitch SVG files | |
require 'nokogiri' | |
require 'base64' | |
IMAGE_HEADER = "data:image/png;base64," | |
ARGV.each do |filename| | |
svg_document = Nokogiri::XML(File.open(filename)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -s -XPOST localhost:9200/_bulk?pretty=true --data-binary ' | |
{ "index" : { "_index" : "parent_child", "_type" : "store", "_id" : "store1" } } | |
{ "name" : "auchan", "owner" : "chris" } | |
{ "index" : { "_index" : "parent_child", "_type" : "department", "_id" : "department1", "parent" : "store1" } } | |
{ "name" : "toys", "numberOfProducts" : 150 } | |
{ "index" : { "_index" : "parent_child", "_type" : "product", "_id" : "product1", "parent" : "department1", "routing" : "store1" } } | |
{ "name" : "gun", "trademark" : "tiger", "price" : 9, "store_id" : "store1" } | |
' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Run me with: | |
# | |
# $ nginx -p /path/to/this/file/ -c nginx.conf | |
# | |
# All requests are then routed to authenticated user's index, so | |
# | |
# GET http://user:password@localhost:8080/_search?q=* | |
# | |
# is rewritten to: | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ======================================== | |
# Testing n-gram analysis in ElasticSearch | |
# ======================================== | |
curl -X DELETE localhost:9200/ngram_test | |
curl -X PUT localhost:9200/ngram_test -d ' | |
{ | |
"settings" : { | |
"index" : { | |
"analysis" : { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -s -XPOST localhost:9200/_bulk?pretty=true --data-binary ' | |
{ "index" : { "_index" : "parent_child", "_type" : "store", "_id" : "store1" } } | |
{ "name" : "auchan", "owner" : "chris" } | |
{ "index" : { "_index" : "parent_child", "_type" : "department", "_id" : "department1", "parent" : "store1" } } | |
{ "name" : "toys", "numberOfProducts" : 150 } | |
{ "index" : { "_index" : "parent_child", "_type" : "product", "_id" : "product1", "parent" : "department1", "routing" : "store1" } } | |
{ "name" : "gun", "trademark" : "tiger", "price" : 9, "store_id" : "store1" } | |
' |
OlderNewer