Skip to content

Instantly share code, notes, and snippets.

View javidjamae's full-sized avatar

Javid Jamae javidjamae

View GitHub Profile
@javidjamae
javidjamae / clone-vim-plugins.sh
Created November 5, 2013 18:21
Script to clone all the vim plugins that I use
git clone https://github.com/scrooloose/nerdtree.git
git clone git://git.wincent.com/command-t.git
git clone https://github.com/kien/ctrlp.vim.git
git clone https://github.com/jistr/vim-nerdtree-tabs.git
git clone git://github.com/mileszs/ack.vim.git
git clone https://github.com/rking/ag.vim
git clone git://github.com/tpope/vim-fugitive.git
git clone git://github.com/tpope/vim-unimpaired.git
git clone git://github.com/tpope/vim-surround.git
git clone git://github.com/tpope/vim-rails.git
@javidjamae
javidjamae / gist:7761895
Last active December 30, 2015 02:19
Diff between Gemfile.lock with jazz_hands and without jazz_hands. ||| Command: diff Gemfile.lock.jazzy Gemfile.lock.nojazz ||| Referenced from: https://github.com/pry/pry/issues/540#issuecomment-29673474
78,87d77
< actionpack (3.2.15)
< activemodel (= 3.2.15)
< activesupport (= 3.2.15)
< builder (~> 3.0.0)
< erubis (~> 2.7.0)
< journey (~> 1.0.4)
< rack (~> 1.4.5)
< rack-cache (~> 1.2)
< rack-test (~> 0.6.1)
@javidjamae
javidjamae / youtube_categories.rb
Created February 12, 2014 00:03
Ruby Hash with all of the Youtube categories and their ids
YOUTUBE_CATEGORIES = {
"Film & Animation" => 1,
"Autos & Vehicles" => 2,
"Music" => 10,
"Pets & Animals" => 15,
"Sports" => 17,
"Short Movies" => 18,
"Travel & Events" => 19,
"Gaming" => 20,
"Videoblogging" => 21,
@javidjamae
javidjamae / gist:0062c9ec3685b04a3e46
Created April 28, 2015 06:36
Console output when I try to bring up wordpress with Docker
11:09:28 ~/workspace/docker/hello-wordpress$ docker-compose up
Recreating hellowordpress_db_1...
Recreating hellowordpress_wordpress_1...
Attaching to hellowordpress_db_1, hellowordpress_wordpress_1
db_1 | 150428 6:09:34 [Note] InnoDB: Using mutexes to ref count buffer pool pages
db_1 | 150428 6:09:34 [Note] InnoDB: The InnoDB memory heap is disabled
db_1 | 150428 6:09:34 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
db_1 | 150428 6:09:34 [Note] InnoDB: Memory barrier is not used
db_1 | 150428 6:09:34 [Note] InnoDB: Compressed tables use zlib 1.2.7
db_1 | 150428 6:09:34 [Note] InnoDB: Using Linux native AIO
@javidjamae
javidjamae / gist:3badec9a9c304de07547
Created May 11, 2015 16:47
Verifying I am +javidjamae on my passcard. https://onename.com/javidjamae
Verifying I am +javidjamae on my passcard. https://onename.com/javidjamae
(function(){
var scriptTag = document.createElement('script');
scriptTag.type = 'text/javascript';
scriptTag.src = 'https://rawgit.com/javidjamae/a6945382f6d30c46ab5a/raw/7229b5ce14566b9658675dd1c8bf8a45bb0fb65a/second.js';
scriptTag.async = true;
document.getElementsByTagName('head')[0].appendChild(scriptTag);
})();
<html>
<head>
<script src="https://rawgit.com/javidjamae/3cfb528a618fa4a1c856/raw/ce98069043ab687ab0982707ec7d9d309e2d184e/shim.js" async></script>
</head>
<body>
This is the HTML for <a href="http://stackoverflow.com/questions/30852198/how-can-i-make-an-inserted-javascript-load-before-domcontentloaded">this question</a> on Stackoverflow.
<table>
<tr><td>Some big useless table to slow down DOM rendering</td></tr>
<tr><td>Some big useless table to slow down DOM rendering</td></tr>
@javidjamae
javidjamae / gist:3cf910c025e2d33cb8cc
Created July 2, 2015 23:53
Console command to determine whether jQuery has loaded properly
jQuery(document).ready(function(){ alert("hi"); })
@javidjamae
javidjamae / gist:0587e2689fccfa2a2e15
Last active August 29, 2015 14:24
Using pow to access Apache on a Vagrant virtual server

This is a much better approach than using Vagrant Hostmanager because you don’t have to worry about polluting your /etc/hosts files on the host or the guest machines. Both the host and the guest machine just treat the guest machine like it’s ‘your-hostname.dev’.

  1. Install pow

    brew install pow
    
  2. Create the port proxy (pow.cx/manual.html#section_2.1.4)

    echo http://127.0.0.1:3333 > ~/.pow/your-hostname
  3. Add the following to your Vagrantfile

    config.vm.network :forwarded_port, guest: 80, host: 3333
    config.vm.hostname = "your-hostname.dev"
    
  4. Create your apache configuration