Skip to content

Instantly share code, notes, and snippets.

@amite
amite / gist:4fa5eb3dbb45120080d6
Created October 10, 2014 01:44
facebook auth_hash without username or nickname field
pp request.env["omniauth.auth"]
{"provider"=>"facebook",
"uid"=>"278975188965788",
"info"=>
{"email"=>"[email protected]",
"name"=>"Dick Ameeiibgeiij Adeagbostein",
"first_name"=>"Dick",
"last_name"=>"Adeagbostein",
"image"=>"https://graph.facebook.com/278975188965788/picture",
"urls"=>
@amite
amite / stack_trace
Created August 29, 2014 16:16
stack trace for render json: bookmarks
app/controllers/api/users_controller.rb:10:in `index'
/Users/amiterandole/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/bundler/gems/active_model_serializers-f29e78f4c873/lib/action_controller/serialization.rb:14:in `initialize'
/Users/amiterandole/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/bundler/gems/active_model_serializers-f29e78f4c873/lib/action_controller/serialization.rb:14:in `new'
/Users/amiterandole/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/bundler/gems/active_model_serializers-f29e78f4c873/lib/action_controller/serialization.rb:14:in `_render_option_json'
actionpack (4.1.5) lib/action_controller/metal/renderers.rb:39:in `block in _handle_render_options'
/Users/amiterandole/.rbenv/versions/2.1.2/lib/ruby/2.1.0/set.rb:263:in `each_key'
/Users/amiterandole/.rbenv/versions/2.1.2/lib/ruby/2.1.0/set.rb:263:in `each'
actionpack (4.1.5) lib/action_controller/metal/renderers.rb:36:in `_handle_render_options'
actionpack (4.1.5) lib/action_controller/metal/renderers.rb:32:in `render_to_body'
actionpack (4.1.5) li
@amite
amite / Added Custom Font in default layout
Last active August 29, 2015 14:05
Pretty Blue Larabook
<link href='http://fonts.googleapis.com/css?family=Roboto' rel='stylesheet' type='text/css'>
Copyright (c) 2011 ZURB, http://www.zurb.com/
echo "This script will:
1) install all modules need to run web2py on Ubuntu/Debian
2) install web2py in /home/www-data/
3) create a self signed sll certificate
4) setup web2py with mod_wsgi
5) overwrite /etc/apache2/sites-available/default
6) restart apache.
You may want to read this script before running it.
#!/bin/bash
###
#
# forked from https://gist.github.com/1264701/08f93534ba177f173b9382b53c419cd0de5b07ea
# Copyright (c) 2011 Cake Development Corporation (http//cakedc.com)
#
# Ubuntu 12.10 based web server installation script
# Run this by executing the following from a fresh install of Ubuntu 12.10 server:
#
<?php
require_once('recaptchalib.php');
// Get a key from https://www.google.com/recaptcha/admin/create
$publickey = "";
$privatekey = "";
# the response from reCAPTCHA
$resp = null;
@amite
amite / laravel deploy.sh
Created November 4, 2013 05:17
laravel deploy on digitalocean
#!/usr/bin/env bash
echo "--- Good morning, master. Let's get to work. Installing now. ---"
echo "--- Updating packages list ---"
sudo apt-get update
echo "--- MySQL time ---"
sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password password root'
sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password_again password root'
service nginx reload
nginx: [alert] could not open error log file: open() "/etc/nginx/logs/error.log" failed (13: Permission denied)
2013/07/05 14:59:24 [warn] 30019#0: the "user" directive makes sense only if the master process runs with super-user privileges, ignored in /etc/nginx/conf/nginx.conf:1
nginx: the configuration file /etc/nginx/conf/nginx.conf syntax is ok
2013/07/05 14:59:24 [emerg] 30019#0: open() "/var/run/nginx.pid" failed (13: Permission denied)
nginx: configuration file /etc/nginx/conf/nginx.conf test failed
@amite
amite / support notes
Created June 7, 2013 10:03
Support section
# Support Section
* schedule a visit
* renew a pass - request a pass
* hotlist visitors
* Raise a sales request - why should this be part of support?
Primary Goal: help customers resolve their trouble tickets
- Log a support ticket
- Follow up on the same ticket