Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am ynnadrules on github.
  • I am ruiz (https://keybase.io/ruiz) on keybase.
  • I have a public key whose fingerprint is CA60 8A91 5667 A9BE D3A7 ABAA 444A 3181 0C18 C80F

To claim this, I am signing this object:

@ynnadrules
ynnadrules / filter.js
Last active November 5, 2015 07:25
Filtering javascript from Sepembre
// Most websites use a javascript library known as jQuery.
// This library is used for finding certain elements on a page by certain attributes and/or by tag name
// and then setting events, finding their neighbors, inserting html, reading values, and pretty much a
// of other things.
//
// The main function is called jQuery(), but $ = jQuery(), so $() is used as a shortcut.
$(function() {
// Here a variable named $container is being set from finding an element with an id attribute of container.
// So for example:
#!/bin/bash
# Install rbenv
# https://github.com/sstephenson/rbenv
cd ~
git clone git://github.com/sstephenson/rbenv.git .rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> .bashrc
echo 'eval "$(rbenv init -)"' >> .bashrc
#!/bin/sh
# Some things taken from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Set the colours you can use
black='\033[0;30m'
white='\033[0;37m'
red='\033[0;31m'
green='\033[0;32m'
@ynnadrules
ynnadrules / gist:27ece64e1639492b260b
Created October 17, 2014 22:00
sigar 0.7.2 yosemite make fail
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
/opt/rubies/2.1.2/bin/ruby extconf.rb
Ruby platform=x86_64-darwin14.0
rbsigar_generated.rx needs update
generating rbsigar_generated.rx
fatal: Not a git repository (or any of the parent directories): .git
../../src/sigar.c -> sigar.c
../../src/sigar_cache.c -> sigar_cache.c
../../src/sigar_fileinfo.c -> sigar_fileinfo.c
@ynnadrules
ynnadrules / gist:1a6b87276b69311e690f
Created October 15, 2014 15:40
Rubymotion Notification Center
def viewWillAppear(animated)
super
@notifcation_observer = App.notification_center.observe SomeNotification do |notification|
some_method_on_this_contorller(notification.object)
end
end
Deploying a Rails 3 App with EC2 + S3 + Ubuntu + Capistrano + Passenger
=======================================================================
EC2 Setup
---------
1 Launch New ec2 instance - ami-1634de7f
2 Create elastic IP [ELASTIC_IP] and associate it with instance
3 go to domain registrar DNS settings, @ and www to ELASTIC_IP
4 set the `:host` in `config/deploy.rb` to ELASTIC_IP
#/usr/bin/env bash
set -e
set -x
apt-get update
apt-get upgrade
apt-get -y install build-essential curl git-core openssl libreadline6 libreadline6-dev \
zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev \
@ynnadrules
ynnadrules / README.md
Last active January 3, 2016 19:48 — forked from agnoster/README.md

agnoster.zsh-theme

A ZSH theme optimized for people who use:

  • Solarized
  • Git
  • Unicode-compatible fonts and terminals (I use iTerm2 + Menlo)

For Mac users, I highly recommend iTerm 2 + Solarized Dark