This file contains hidden or 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
require 'rubygems' | |
require 'typhoeus' | |
hydra = Typhoeus::Hydra.new | |
# Create all your requests | |
request = Typhoeus::Request.new("http://your_image_url") | |
request.on_complete do |response| | |
# Check if the returned data really is an image | |
This file contains hidden or 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
// start CategoryRoot=node(258) match CategoryRoot<-[:model_type]-Category<-[:InstrumentCategorization]-Instrument return Category, collect(Instrument) | |
{ | |
"data": [ | |
[{ | |
"outgoing_relationships": "http://localhost:7477/db/data/node/259/relationships/out", | |
"data": { | |
"name_en": "Wind instruments", | |
"architect4r_type": "InstrumentCategory", |
This file contains hidden or 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
#require 'spec_helper' | |
#require_relative '../../../app/domain/geocoder_wrapper' | |
require 'rspec/autorun' | |
class GeocodeWrapper | |
def self.geocode(name) | |
0 | |
#Geocoder.search(name) | |
end |
This file contains hidden or 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
description "Your App" | |
author "Maximilian Schulz <[email protected]>" | |
# Define when to run the app | |
start on (local-filesystems and runlevel [2345]) | |
stop on runlevel [016] | |
# Default config | |
respawn | |
respawn limit 10 5 |
This file contains hidden or 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
require 'smartcard' | |
#UID_CMD = "\xFF\xCA\x00\x00\x00" | |
UID_CMD = "\xFF\xCA\x00\x00\x00" | |
def format_readable(sequence) | |
sequence.to_s.unpack('C*').join | |
end | |
stop = false |
This file contains hidden or 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
html { | |
background-color: #32b93c; | |
padding: 60px 30px; | |
} | |
body { | |
font-family: Helvetica, arial, sans-serif; | |
font-size: 14px; | |
line-height: 1.6; | |
padding-top: 10px; | |
padding-bottom: 10px; |
This file contains hidden or 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
class FakeService | |
def self.call(env) | |
[200, { 'Content-Type' => 'application/json' }, ['{ "name": "John Doe" }']] | |
end | |
end |
This file contains hidden or 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
# Create a rsa key with 4096 bit encryption. This is far more secure than 2048. | |
# The email is just a plain comment. Make sure you enter a passphrase! | |
ssh-keygen -t rsa -b 4096 -C "[email protected]" | |
# The basic passphrase security is rather bad and easy to break. Read the following article why: | |
# http://martin.kleppmann.com/2013/05/24/improving-security-of-ssh-private-keys.html | |
mv id_rsa id_rsa.old | |
openssl pkcs8 -topk8 -v2 des3 -in ~/.ssh/id_rsa.old -out ~/.ssh/id_rsa | |
chmod 600 ~/.ssh/id_rsa |
This file contains hidden or 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
server { | |
server_name localhost; | |
listen 80; | |
root /home/app/webapp/public; | |
passenger_enabled on; | |
passenger_user app; | |
passenger_ruby /usr/bin/ruby2.1; | |
} |
This file contains hidden or 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
# $ rails new searchapp --skip --skip-bundle --template https://raw.github.com/elasticsearch/elasticsearch-rails/master/elasticsearch-rails/lib/rails/templates/03-complex.rb | |
# (See: 01-basic.rb, 02-pretty.rb) | |
append_to_file 'README.rdoc', <<-README | |
== [3] Expert | |
The `expert` template changes to a complex database schema with model relationships: article belongs | |
to a category, has many authors and comments. |
OlderNewer