Note: dm is an alias for docker-machine
dm ls
dm create -d virtualbox hello-world
dm env hello-world
heroku pg:reset DATABASE --confirm db-name
heroku pg:push local-db-name heroku-db-name --app app-name
heroku run rake db:migrate
| <?php | |
| ### | |
| # NOTE: This code won't work with PHP 7. | |
| # MySQL is deprecated and will be removed in PHP 7 checkout MySQLi. | |
| ### | |
| ############## JUST FILL THESE VARIABLES ###### | |
| $dbname = 'name'; # Name of the Database in the MySQL Server | |
| $dbuser = 'user'; # User name of the database in MySQL | |
| $dbpass = 'pass'; # Password for the user of in database in MySQL | |
| $dbhost = 'host'; # url/link to database |
| # This URL was useful: https://gist.github.com/iangreenleaf/b206d09c587e8fc6399e | |
| ############################################################ | |
| ################### ROUTES #################### | |
| ############################################################ | |
| get 'welcome/home', to: 'welcome#home' # HTTP GET /welcome/home to controller: welcome action(Method): home. | |
| # Should have controller WelcomeController < ApplicationController | |
| # controller should have action(Method) home | |
| # should have a template (view) in app/views/welcome/home.html.erb |
| /* | |
| To run this: | |
| open command prompt execute 'swipl' | |
| then run ['path/to/this/file.pl']. | |
| then query away. | |
| */ | |
| % FACTS | |
| likes(jana, omar). | |
| likes(omar, jana). |
| // Here we demonstrate functions in swift | |
| // Concentrating on three points: | |
| // * Pass-by-Value | |
| // * Pass-by-Reference | |
| // * External Name / Internal Name | |
| // | |
| // Drop this in a playground to see instant results. | |
| func combineStr(str1: String, str2: String) -> String { |
| // Here we demonstrate working with Optionals in Swift | |
| // in Swift, Optionals are basically the type which is allowed to hold (reference to be more accurate) a null (nil). | |
| // We use "?" to declare an optional | |
| var age: Int? | |
| if age == nil { | |
| // Since age is nil | |
| // This will be executed | |
| print("There is no age") |
| #!/usr/bin/env ruby | |
| # Full Contol on Ethnet, IP & TCP headers. Play with it ;) | |
| # to test it: nc -lvp 4444 | |
| # as root: tcpdump -nvvvv 'tcp port 4444' -i wlan0 # change wlan0 to your interface | |
| # or use packetfu to monitor as tcpdump | |
| # on OSX exchange wlan0 to en0 | |
| ## cap = PacketFu::Capture.new(:iface => 'wlan0' , :promisc=> true) | |
| ## cap.show_live(:filter => 'tcp and port 4444') | |
| # libpcap should be installed | |
| # gem install pcaprub packetfu |
| class GraphqlController < ApplicationController | |
| skip_before_action :verify_authenticity_token | |
| def query | |
| result_hash = Schema.execute(params[:query], variables: params[:variables]) | |
| render json: result_hash | |
| end | |
| end |