Skip to content

Instantly share code, notes, and snippets.

View yeco's full-sized avatar

Jasson Cascante yeco

View GitHub Profile
@yeco
yeco / HelloDartTest.dart
Created October 1, 2020 22:50 — forked from ghchinoy/HelloDartTest.dart
Dart compiled to JavaScript & Optimized JavaScript (--optimize)
// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// Simple test program invoked with an option to eagerly
// compile all code that is loaded in the isolate.
// VMOptions=--compile_all
class HelloDartTest {
static testMain() {
print("Hello, Darter!");
@yeco
yeco / gist:9223795
Created February 26, 2014 05:00 — forked from gf3/gist:328089
Black: 0, 0, 0
Red: 229, 34, 34
Green: 166, 227, 45
Yellow: 252, 149, 30
Blue: 196, 141, 255
Magenta: 250, 37, 115
Cyan: 103, 217, 240
White: 242, 242, 242
@yeco
yeco / gist:8910987
Last active August 29, 2015 13:56 — forked from nickmccurdy/gist:8482253

Homesick Reference

homesick cd CASTLE              # Open a new shell in the root of the given castle
homesick clone URI              # Clone +uri+ as a castle for homesick
homesick commit CASTLE MESSAGE  # Commit the specified castle's changes
homesick destroy CASTLE         # Delete all symlinks and remove the cloned repository
homesick diff CASTLE            # Shows the git diff of uncommitted changes in a castle
homesick generate PATH          # generate a homesick-ready git repo at PATH
homesick help [COMMAND]         # Describe available commands or one specific command
homesick list                   # List cloned castles
App.PickADate = Ember.View.extend({
attributes: ['monthsFull', 'monthsShort', 'weekdaysFull', 'weekdaysShort',
'monthPrev', 'monthNext', 'showMonthsFull', 'showWeekdaysShort', 'today',
'clear', 'format', 'formatSubmit', 'hiddenSuffix', 'firstDay', 'monthSelector',
'yearSelector', 'dateMin', 'dateMax', 'datesDisabled', 'disablePicker'],
events: ['onOpen', 'onClose', 'onSelect', 'onStart'],
tagName: 'input',
classNames: 'pickadate',
@yeco
yeco / $.js
Created May 14, 2013 18:56 — forked from potfur/$.js
// Based on https://github.com/james2doyle/saltjs
window.$ = function(s) {
return document[{
'#': 'getElementById',
'.': 'getElementsByClassName',
'@': 'getElementsByName',
'=': 'getElementsByTagName'}[s[0]]
|| 'querySelectorAll'](s.slice(1))
};
@yeco
yeco / gist:2551711
Created April 29, 2012 16:30 — forked from padolsey/gist:2521471
Regular click event for touch devices [jQuery]
'createTouch' in document && (jQuery.event.special.click = {
setup: function(data, namespaces, eventHandle) {
var t;
$(this).bind('touchstart.touchClick', function() {
t = +new Date;
}).bind('touchend.touchClick', function(e) {
if (+new Date < t + 200) {
$(this).trigger('click', e);
}
})
@yeco
yeco / pubsub.md
Created April 29, 2012 07:16 — forked from addyosmani/pubsub.md
Four ways to do Pub/Sub with jQuery 1.7 and jQuery UI (in the future)

#Four Ways To Do Pub/Sub With jQuery 1.7 and jQuery UI (in the future)

Between jQuery 1.7 and some of work going into future versions of jQuery UI, there are a ton of hot new ways for you to get your publish/subscribe on. Here are just four of them, three of which are new.

(PS: If you're unfamiliar with pub/sub, read the guide to it that Julian Aubourg and I wrote here http://msdn.microsoft.com/en-us/scriptjunkie/hh201955.aspx)

##Option 1: Using jQuery 1.7's $.Callbacks() feature:

$.Callbacks are a multi-purpose callbacks list object which can be used as a base layer to build new functionality including simple publish/subscribe systems. We haven't yet released the API documentation for this feature just yet, but for more information on it (including lots of examples), see my post on $.Callbacks() here:

@yeco
yeco / hack.sh
Created April 25, 2012 20:13
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2492984/hack.sh | sh
#
/**
* parseTemplate takes a string and a JS Object and returns a string with template
* replaced with content you provided. Template tags look like: {{tag}}
* @param {String} s This is the string to search for tags in.
* @param {Object} j This is the JS object that contains a key=>value pair for the tag and what to be replaced
* @returns {String} returns the modified string with the content you provided in replacement of the tags
* @example var html = parseTemplate('Hey, {{name}}',{ name:'John' }); //returns "Hey, John"
*/
var parseTemplate = function(s,j){
for(x in j){ var r = new RegExp('{{'+x+'}}','g'); s = s.replace(r,j[x]); }
@yeco
yeco / HelloDartTest.dart
Created October 11, 2011 04:38
Dart Compilation
// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// Simple test program invoked with an option to eagerly
// compile all code that is loaded in the isolate.
// VMOptions=--compile_all
class HelloDartTest {
static testMain() {
print("Hello, Darter!");