Skip to content

Instantly share code, notes, and snippets.

@codexico
codexico / gist:10409140
Created April 10, 2014 18:23
show hidden files on finder
defaults write com.apple.Finder AppleShowAllFiles TRUE; killall Finder
@codexico
codexico / log_args
Created April 21, 2014 20:02
javascript log arguments
function log_args () {
console.log([].slice.call(arguments))
}
@codexico
codexico / social.js
Created April 23, 2014 13:30
share functions
function shareFacebook(title, summary, url, image) {
url = ['https://www.facebook.com/sharer/sharer.php?s=100&p[summary]=', encodeURI(summary), '&p[title]=', encodeURI(title), '&p[url]=', encodeURI(url), '&p[images][0]=', encodeURI(image)];
window.open(url.join(''), 'facebook', 'height=300,width=600');
}
function shareFacebookFBui(options, callbackShare) {
// http://developers.facebook.com/docs/reference/dialogs/feed/
var defaults = {
method: 'feed',
-webkit-transform: translate3d(0, 0, 0);
-webkit-filter: blur(30px);
-moz-filter: blur(30px);
-o-filter: blur(30px);
-ms-filter: blur(30px);
filter: progid:DXImageTransform.Microsoft.Blur(PixelRadius='60');
@codexico
codexico / robot.js
Created December 5, 2012 03:30
xicoloco
var Robot = function (robot) {};
Robot.prototype.onIdle = function (ev) {
var robot = ev.robot;
//search
robot.ahead(4);
robot.rotateCannon(6);
robot.turn(1);
};
@codexico
codexico / robot.js
Created December 5, 2012 03:35 — forked from jsyrek/robot.js
QR-bot-009
//FightCode can only understand your robot
//if its class is called Robot
var Robot = function(robot) {
var rx = robot.position.x;
var ry = robot.position.y;
var aH = robot.arenaHeight;
var aW = robot.arenaWidth;
robot.clone()
};
@codexico
codexico / robot.js
Created December 5, 2012 05:01 — forked from rfloriano/robot.js
[CAELUM TEAM]Megatron
//FightCode can only understand your robot
//if its class is called Robot
var Robot = function(robot) {
};
Robot.prototype.onIdle = function(ev) {
var robot = ev.robot;
robot.clone();
var matched, browser;
// Use of jQuery.browser is frowned upon.
// More details: http://api.jquery.com/jQuery.browser
// jQuery.uaMatch maintained for back-compat
jQuery.uaMatch = function( ua ) {
ua = ua.toLowerCase();
var match = /(chrome)[ \/]([\w.]+)/.exec( ua ) ||
/(webkit)[ \/]([\w.]+)/.exec( ua ) ||
//http://tryhandlebarsjs.com/
//{{#list_fl people}}{{firstName}} {{lastName}}{{/list_fl}}
{
people : [
{ firstName: "Yehuda", lastName: "Katz" },
{ firstName: "Carl", lastName: "Lerche" },
{ firstName: "Alan", lastName: "Johnson" }
]
@codexico
codexico / utils.js
Created January 28, 2013 16:44
date utils
//http://stackoverflow.com/questions/7388001/javascript-regex-to-validate-date
//http://jsfiddle.net/mplungjan/Mqh8D/
var isDate = function (str) {
var parms = str.split(/[\.\-\/]/);
var yyyy = parseInt(parms[2],10);
var mm = parseInt(parms[1],10);
var dd = parseInt(parms[0],10);
var date = new Date(yyyy,mm-1,dd,0,0,0,0);
return mm === (date.getMonth()+1) && dd === date.getDate() && yyyy === date.getFullYear();
}