SSH into Root
$ ssh [email protected]
Change Root Password
First off you need to modify application/config/rest.php | |
``` | |
$config['rest_default_format'] = 'json'; | |
``` | |
This will ensure that when your api call is made the server will return json without an additional segment. | |
You must then create an api controller that will return your codeigniter model in the correct format for Ember.js | |
``` | |
<?php | |
require(APPPATH.'/libraries/REST_Controller.php'); |
SSH into Root
$ ssh [email protected]
Change Root Password
Rails.application.routes.draw do | |
scope "/:locale" do | |
# blablabla.. | |
end | |
root to: "welcome#index" | |
get '/:locale' => 'welcome#index', :as => 'locale_root' | |
end |
/* Backbone API: Facebook | |
* Source: https://github.com/backbone-api/facebook | |
* | |
* Created by Makis Tracend (@tracend) | |
* Distributed through [Makesites.org](http://makesites.org) | |
* Released under the [MIT license](http://makesites.org/licenses/MIT) | |
*/ | |
// Assuming that Facebook JS lib is loaded... | |
if( window.FB ) (function(_, Backbone) { |
define([ | |
'backbone', | |
'underscore', | |
'project/views/form' | |
], function(Backbone, _, ProjectFormView) { | |
var View = Backbone.View.extend({ | |
events: { | |
'submit form': 'submit' | |
}, |
Version numbers should be the ones you want. Here I do it with the last ones available at the moment of writing.
The simplest way to install elixir is using your package manager. Sadly, at the time of writing only Fedora shows
the intention to keep its packages up to date. There you can simply sudo dnf install erlang elixir
and you are good to go.
Anyway, if you intend to work with several versions of erlang or elixir at the same time, or you are tied to
a specific version, you will need to compile it yourself. Then kerl
and exenv
are your best friends.
# This copies a file from HTTP to S3 | |
require 'net/http' | |
require 'aws/s3' | |
http_url = 'http://www.google.com/intl/en_com/images/srpr/logo1w.png' | |
http_domain = http_url.gsub('http://','').split('/')[0] | |
http_path = '/' + http_url.gsub('http://','').split('/')[1..999].join('/') | |
file_name = File.basename(http_url) | |
s3_path = "path/to/new/#{file_name}" |
nginx: | |
image: fntlnz/nginx | |
volumes: | |
- docker/nginx/conf:/usr/local/nginx/conf | |
- docker/nginx/logs:/usr/local/nginx/logs | |
volumes_from: | |
- fpm | |
links: | |
- fpm:fpm |
var user = "hantu"; | |
$(document).ready(function() { | |
$.getJSON("http://github.com/api/v1/json/" + user + "?callback=?", function(data) { | |
$.each(data.user.repositories, function() { | |
$("body").append( | |
"<p><a href=\"" + this.url + "\">" + this.name + "</a></p>" | |
); | |
}); | |
}); | |
}); |
# lib/addons/carrierwave/gif_processes.rb | |
# | |
# Addons to CarrierWave to process GIF files with RMagick. | |
# | |
# Example: | |
# | |
# class AvatarUploader < CarrierWave::Uploader::Base | |
# include CarrierWave::GifProcesses | |
# | |
# version :medium do |