Skip to content

Instantly share code, notes, and snippets.

View jmonterroso's full-sized avatar

Jayson Monterroso jmonterroso

View GitHub Profile
@jmonterroso
jmonterroso / README.md
Last active August 29, 2015 14:11 — forked from micjamking/README.md

Deploying Yeoman apps to Heroku

Prerequisites

This assumes you already have a Yeoman app and are ready for publishing

Build for Production

Create production directory & assets

@jmonterroso
jmonterroso / find-larger-width
Last active August 29, 2015 14:15
Larger element than width
$('*').each(function () {
var viewportWidth = 1024;
var outerWidth = $(this).outerWidth();
if( outerWidth > viewportWidth ){
//prints element in console so you can check what's the element
console.log($(this)[0]);
}
});
@jmonterroso
jmonterroso / attached-events.js
Created April 14, 2015 15:35
jQuery Attached Events
("#foo").on({
click: function(){ alert("Hello") },
mouseout: function(){ alert("World") }
});​​​
// Lookup events for this particular Element
​$._data( $("#foo")[0], "events" );
$._data($("#button1").get(0),"events")
@jmonterroso
jmonterroso / ios.md
Created April 14, 2015 20:15
Open iOS simulator from terminal

Apple has introduced an interesting tool with Xcode 6!

simctl

simclt allows you to control the simulators running

run xcrun simctl to get the list of available subcommands. Lots of new options to play around.

Now to do what I wanted. Here is the command to launch simulator

@jmonterroso
jmonterroso / chrome-no-cors.md
Created April 15, 2015 18:16
Open Chrome without CORS restriction

For OSX, open Terminal and run:

$ open -a Google\ Chrome --args --disable-web-security For Linux run:

$ google-chrome --disable-web-security

Also if you're trying to access local files for dev purposes like AJAX or JSON, you can use this flag too.

-–allow-file-access-from-files

@jmonterroso
jmonterroso / legal-notes-validation.js
Created April 15, 2015 20:51
FootNotes validation
@jmonterroso
jmonterroso / sublime.md
Created April 20, 2015 20:34
Open sublime from terminal

Open sublime from terminal

ln -s "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl" /usr/local/bin/subl

@jmonterroso
jmonterroso / vertical-alignment.css
Created April 26, 2015 00:12
Vertical alignment with three lines
.element {
position: relative;
top: 50%;
transform: translateY(-50%);
}
/* Mixin */
@mixin vertical-align {
position: relative;
top: 50%;
@jmonterroso
jmonterroso / input.md
Last active August 29, 2015 14:21
autocomplete form in angularjs

Autocomplete form and then run

$('.custom.desktop-form').find('input, textarea, select').trigger('input').trigger('change').trigger('keydown')

@jmonterroso
jmonterroso / python-easy-server.md
Created June 1, 2015 16:59
Easy Python server.
 python -m SimpleHTTPServer 8000