Skip to content

Instantly share code, notes, and snippets.

View keybase.md

Keybase proof

I hereby claim:

  • I am gnumarcelo on github.
  • I am winter_mute (https://keybase.io/winter_mute) on keybase.
  • I have a public key ASCOeHS2Yy8h_FxTyBwTyHYwwuWNDip3H8-9XOvAA6qA1Ao

To claim this, I am signing this object:

View nuxt-auth-redirect.js
//plugins/axios.js
export default function ({ $axios, app }) {
$axios.onError(error => {
const code = parseInt(error.response && error.response.status)
if ([401, 403].includes(code)) {
app.$auth.logout();
}
View eth-key
0xdc7875492b26a36f2e3142530b5ac25ad1f90f9d
View unicorn.rb
root = "/home/mrhuman/apps/YOUR_APP_NAME/current"
working_directory root
pid "#{root}/tmp/pids/unicorn.pid"
stderr_path "#{root}/log/unicorn.log"
stdout_path "#{root}/log/unicorn.log"
# change the YOUR_APP_NAME to your application name
listen "/tmp/unicorn.YOUR_APP_NAME.sock"
worker_processes 2
timeout 30
View unicorn_init.sh
#!/bin/sh
set -e
# Feel free to change any of the following variables for your app:
TIMEOUT=${TIMEOUT-60}
APP_ROOT=/home/mrhuman/apps/YOUR_APP_NAME/current
PID=$APP_ROOT/tmp/pids/unicorn.pid
CMD="cd $APP_ROOT; bundle exec unicorn -D -c $APP_ROOT/config/unicorn.rb -E production"
AS_USER=mrhuman
set -u
View gist:e9433bf5c225155f8c54
# https://github.com/gzigzigzeo/carrierwave-meta
# Integrating CarrierWave with JCrop
# Let implement the behavior like at this demo: deepliquid.com/projects/Jcrop/demos.php?demo=thumbnail
# The uploader:
class CropUploader < SobakaUploader
include CarrierWave::Meta
# Crop source is a source image converted from original which could be bigger than source area (left image in the example).
version :crop_source do
View ot.js
var OT=OT||{};OT.api=OT.api||{};(function(){function t(e,t){_rIds=e.replace(/\,/g,"");var n=setInterval(function(){if(ranking[_rIds]!==undefined){try{t.call(this,ranking[_rIds])}catch(e){}clearInterval(n)}},500)}function n(t){var n="icS="+e.icS;for(var r in t){if(encodeURIComponent(t[r])!=="")n+="&"+r+"="+encodeURIComponent(t[r])}return n}function r(e,t){var n=document.createElement("script");n.type="text/javascript";n.src=t+e;n.async=true;var r=document.getElementsByTagName("script")[0];r.parentNode.insertBefore(n,r)}function s(e,t){if(u(e))return;var n=new Date;var r=new Date(n.getTime()+999*24*60*60*1e3);var r=r.toGMTString();document.cookie=e+"="+t+";expires="+r}function o(e){var t=e+"=";var n=document.cookie.split(";");for(var r=0;r<n.length;r++){var i=n[r];while(i.charAt(0)==" ")i=i.substring(1,i.length);if(i.indexOf(t)==0)return i.substring(t.length,i.length)}return null}function u(e){if(document.cookie.length>0){c_start=document.cookie.indexOf(e+"=");if(c_start!=-1)return true;return false}}function f
@gnumarcelo
gnumarcelo / environment.rb
Created Oct 16, 2010
Sample of a Rails 2.3.5 environment config file for Campaigning GEM
View environment.rb
# Be sure to restart your server when you modify this file
# Specifies gem version of Rails to use when vendor/rails is not present
RAILS_GEM_VERSION = '2.3.5' unless defined? RAILS_GEM_VERSION
CAMPAIGN_MONITOR_API_KEY = 'put_your_api_key_here'
# Bootstrap the Rails environment, frameworks, and default configuration
require File.join(File.dirname(__FILE__), 'boot')