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
// HTTP JSON API. | |
#include <EtherCard.h> | |
#include <DHT.h> | |
#include <Wire.h> | |
#include <Adafruit_BMP085_U.h> | |
// Ethernet: |
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
## rpc.gd | |
# An experiment in using HTTPClient | |
# for blocking RPCs | |
# @author bibby<[email protected]> | |
# | |
# get( url ) | |
# post( url, body ) | |
# put( url, body ) | |
# delete( url ) |
- Example groups are executed in random orders so setting let must be taken care of
- before(:all) does not rollback transaction! Test data created remains in the test database!
However, running rspec (on cmd line) will clear the test database.
rake db:test:prepare
will also clear the test database.
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
/* Gruntfile.js | |
* Grunt workflow for building AngularJS/Ionic applications. | |
*/ | |
module.exports = function(grunt) { | |
grunt.initConfig({ | |
pkg: grunt.file.readJSON('package.json'), | |
coffee: { | |
compile: { |
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
// Reference: http://www.blackdogfoundry.com/blog/moving-repository-from-bitbucket-to-github/ | |
// See also: http://www.paulund.co.uk/change-url-of-git-repository | |
$ cd $HOME/Code/repo-directory | |
$ git remote rename origin bitbucket | |
$ git remote add origin https://github.com/mandiwise/awesome-new-repo.git | |
$ git push origin master | |
$ git remote rm bitbucket |
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
So i was using Rails 4.1 with Unicorn v4.8.2 and when i tried to deploy my app it doesn't start properly and into the unicorn.log file i found this error message: | |
"app error: Missing `secret_key_base` for 'production' environment, set this value in `config/secrets.yml` (RuntimeError)" | |
After a little research i found that Rails 4.1 change the way to manage the secret_key, so if we read the secrets.yml file located at exampleRailsProject/config/secrets.yml (you need to replace "exampleRailsProject" for your project name) you will find something like this: | |
# Do not keep production secrets in the repository, | |
# instead read values from the environment. | |
production: | |
secret_key_base: <%= ENV["SECRET_KEY_BASE"] %> |
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
# Be sure to save your config files. Optional but I do: | |
sudo cp /etc/postgresql/9.3/main/postgresql.conf ~ | |
sudo cp /etc/postgresql/9.3/main/pg_hba.conf ~ | |
# Package repo (for apt-get) | |
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add - | |
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ precise-pgdg main" >> /etc/apt/sources.list.d/postgresql.list' | |
# Also probably optional but I like to update sources and upgrade | |
sudo apt-get update |
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 Api::RegistrationsController < Api::BaseController | |
respond_to :json | |
def create | |
user = User.new(params[:user]) | |
if user.save | |
render :json=> user.as_json(:auth_token=>user.authentication_token, :email=>user.email), :status=>201 | |
return | |
else |
OlderNewer