Skip to content

Instantly share code, notes, and snippets.

View hsanchez's full-sized avatar
I may be slow to respond.

Huascar Sanchez hsanchez

I may be slow to respond.
View GitHub Profile
## Prepare ###################################################################
# Remove RVM
rvm implode
# Ensure your homebrew is working properly and up to date
brew doctor
brew update
## Install ###################################################################
@hsanchez
hsanchez / cast_ffi.rb
Created February 14, 2013 23:11 — forked from dougm/cast_ffi.rb
#only dealing with opaque types here; no struct gen
require 'cast'
CallbackTypes = {}
def ffi_type(t)
if t.Pointer?
if t.type.Char?
:string
elsif t.type.CustomType? and CallbackTypes[t.type.name]
<script>
// Charles Lawrence - Feb 16, 2012. Free to use and modify. Please attribute back to @geuis if you find this useful
// Twitter Bootstrap Typeahead doesn't support remote data querying. This is an expected feature in the future. In the meantime, others have submitted patches to the core bootstrap component that allow it.
// The following will allow remote autocompletes *without* modifying any officially released core code.
// If others find ways to improve this, please share.
var autocomplete = $('#searchinput').typeahead()
.on('keyup', function(ev){
ev.stopPropagation();
@hsanchez
hsanchez / installing_scala_on_mac_with_brew.txt
Last active December 21, 2015 02:58
installing Scala 2.10.x with homebrew
# installing the latest stable version:
brew install scala --with-docs
# switching versions (from https://github.com/mxcl/homebrew/wiki/External-Commands):
brew switch scala 2.9.3
brew switch scala 2.10.2
# checking which scala version you're currently using:
brew which scala
package com.beust.coding.challenge.slidingwindowmap;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
/**
*
* @author rnaufal
*
package com.bitgrind.android.guice;
import com.google.common.base.Preconditions;
import com.google.common.base.Throwables;
import com.google.inject.Binder;
import com.google.inject.Guice;
import com.google.inject.Injector;
import com.google.inject.Module;
import com.google.inject.util.Modules;
/**
* Following Gist provides
*
* - BaseRepository,
* - Respositories Trait/Implementation,
* - BaseService,
* - Services Traits/Implementations
* - Config to tie services and repositories
* - Registry to add environment specific config like spring profiles (this is for Play framework)
*/
@hsanchez
hsanchez / ab.sh
Created November 7, 2013 20:00 — forked from brentertz/ab.sh
#!/bin/bash
COOKIE_JAR="ab-cookie-jar"
COOKIE_NAME="_myapp_session"
USERNAME="[email protected]"
PASSWORD="password"
LOGIN_PAGE_URI="http://localhost:3000/users/sign_in"
TEST_PAGE_URI="http://localhost:3000/dashboard"
echo "Logging in and storing session id."

#Introduction

Developing Chrome Extensions is REALLY fun if you are a Front End engineer. If you, however, struggle with visualizing the architecture of an application, then developing a Chrome Extension is going to bite your butt multiple times due the amount of excessive components the extension works with. Here are some pointers in how to start, what problems I encounter and how to avoid them.

Note: I'm not covering chrome package apps, which although similar, work in a different way. I also won't cover the page options api neither the new brand event pages. What I explain covers most basic chrome applications and should be enough to get you started.

Table of Contents

  1. Understand the Chrome Architecture
  2. Understand the Tabs-Extension Relationship
  3. Picking the right interface for the job
<!DOCTYPE html>
<html>
<head>
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.2.5/angular.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/codemirror/3.20.0/codemirror.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/codemirror/3.20.0/addon/hint/javascript-hint.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/codemirror/3.20.0/mode/javascript/javascript.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/codemirror/3.20.0/addon/edit/matchbrackets.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/codemirror/3.20.0/addon/display/fullscreen.min.js"></script>