Wednesday 31 July 2013

ruby_metaprogramming

ECMAScript 5: Tamper proofing objects

instance_values

Active Record loves blocks

instance_eval && class_eval

Keyboard Shortcuts for Bash


Ctrl + AGo to the beginning of the line you are currently typing on
Ctrl + EGo to the end of the line you are currently typing on
Ctrl + L              Clears the Screen, similar to the clear command
Ctrl + UClears the line before the cursor position. If you are at the end of the line, clears the entire line.
Ctrl + HSame as backspace
Ctrl + RLet’s you search through previously used commands
Ctrl + CKill whatever you are running
Ctrl + DExit the current shell
Ctrl + ZPuts whatever you are running into a suspended background process. fg restores it.
Ctrl + WDelete the word before the cursor
Ctrl + KClear the line after the cursor
Ctrl + TSwap the last two characters before the cursor
Esc + TSwap the last two words before the cursor
Alt + FMove cursor forward one word on the current line
Alt + BMove cursor backward one word on the current line
TabAuto-complete files and folder names
http://www.howtogeek.com/howto/ubuntu/keyboard-shortcuts-for-bash-command-shell-for-ubuntu-debian-suse-redhat-linux-etc/

wget links

seed



via Instagram http://instagram.com/p/ca9hzKr5da/

Tuesday 16 July 2013

newrelic_rpm with Rails 4 on heroku

There is a bug in newrelics config file

The solution:



1. in config/newrelic.yml

line 46  replace

app_name: <%= ENV["NEW_RELIC_APP_NAME"] %>

view is var in defined in heroku

blah:(master) ✗ heroku config
DATABASE_URL                 =>
HEROKU_POSTGRESQL_COBALT_URL =>
NEW_RELIC_LICENSE_KEY        =>
NEW_RELIC_LOG                =>
PAPERTRAIL_API_TOKEN         =>

set the var

heroku config:set NEW_RELIC_APP_NAME=new_app

also in ~/.profile

export NEW_RELIC_APP_NAME=my_app

Tuesday 2 July 2013

Adapt.js responsive without bootstrap

What is this?


 Adapt.js is a lightweight (848 bytes minified) JavaScript file that determines which CSS file to load before the browser renders a page. If the browser tilts or resizes, Adapt.js simply checks its width, and serves only the CSS that is needed, when it is needed.



 http://adapt.960.gs/


// Edit to suit your needs.
var ADAPT_CONFIG = {
  // Where is your CSS?
  path: 'assets/css/',

  // false = Only run once, when page first loads.
  // true = Change on window resize and page tilt.
  dynamic: true,

  // Optional callback... myCallback(i, width)
  callback: myCallback,

  // First range entry is the minimum.
  // Last range entry is the maximum.
  // Separate ranges by "to" keyword.
  range: [
    '0px    to 760px  = mobile.css',
    '760px  to 980px  = 720.css',
    '980px  to 1280px = 960.css',
    '1280px to 1600px = 1200.css',
    '1600px to 1920px = 1560.css',
    '1940px to 2540px = 1920.css',
    '2540px           = 2520.css'
  ]
};