Skip to content

Instantly share code, notes, and snippets.

View Papacidero's full-sized avatar

Carlos Eduardo Papacidero Papacidero

View GitHub Profile
@Papacidero
Papacidero / keymap.cson
Created June 8, 2016 12:28
Overwrites the new Keymap for ctrl+tab keys to the old way.
'body':
'ctrl-tab ^ctrl': 'unset!'
'ctrl-tab': 'pane:show-next-item'
'ctrl-shift-tab ^ctrl': 'unset!'
'ctrl-shift-tab': 'pane:show-previous-item'
@Papacidero
Papacidero / file.js
Last active August 29, 2015 14:06
Watch File and Copy Node Js
var fs = require("fs");
var ncp = require("ncp").ncp;
fs.watchFile("arquivo.txt", function(current, previous) {
console.log("MEXEU");
ncp.limit = 16;
ncp("arquivo.txt", "arquivo2.txt", function (err) {
if (err) {
return console.error(err);
}
@Papacidero
Papacidero / gist:9f20cd366f894935bbb0
Created September 8, 2014 11:45
Javascript Arguments as Array
function argumentsAsArray() {
var args = Array.prototype.slice.call(arguments);
console.log(args);
}
argumentsAsArray('argument_01', 'argument_02', 'argument_03');
@Papacidero
Papacidero / Simple Javascript Constructor Object
Created August 15, 2014 01:46
Simple Javascript Constructor Object
function myObject(what){
this.iAm = what;
this.whatAmI = function(language){
alert('I am ' + this.iAm + ' of the ' + language + ' language');
};
};
var myNewObject = new myObject('an object');
myNewObject.whatAmI('JavaScript');
@Papacidero
Papacidero / Wordpress Child Theme
Created July 31, 2014 12:14
Wordpress Child Theme
/*
Theme Name: Twenty Fourteen Child
Theme URI: http://example.com/twenty-fourteen-child/
Description: Twenty Fourteen Child Theme
Author: John Doe
Author URI: http://example.com
Template: twentyfourteen
Version: 1.0.0
Tags: light, dark, two-columns, right-sidebar, responsive-layout, accessibility-ready
Text Domain: twenty-fourteen-child
@Papacidero
Papacidero / gist:5459792
Created April 25, 2013 13:44
WIN8: How to define, change and rescue Global Vars in a Javascript Win8 App
//Declare Global Variable
WinJS.Namespace.define("MyGlobals", {
variable1: 'Value 1',
variable2: 'Value 2',
});
//Change Variable
MyGlobals.variable1 = "Your value 1";
MyGlobals.variable2 = "Your value 2";
@Papacidero
Papacidero / gist:5321772
Created April 5, 2013 19:05
css: Center Div (Horizontal, Vertical)
/*Position the Element 50% left and 50% top, and remove half of size of the object to center it in the middle.*/
.element {
height:400px;
width:200px;
left:50%;
top:50%;
position:absolute;
/*Height and Width Divide by 2*/
margin:-200px 0 0 -100px;
}
@Papacidero
Papacidero / gist:5301614
Created April 3, 2013 14:18
Javascript: Get Brazilian Date (Ex: Quarta-Feira, 3 de Abril de 2013)
//Create Date
var date = new Date();
//Create Month Array
var months = [
"Janeiro",
"Fevereiro",
"Março",
"Abril",
"Maio",
@Papacidero
Papacidero / gist:5195681
Created March 19, 2013 12:26
Jquery: CSS Animation Start, Reset, Restart
//Sample Button Handler to Start animation on div .box
$('button').on('click', function(event) {
event.preventDefault();
startAnimation('animation 1s ease-in','.box')
});
/**
* Handle Animation (Start, Reset, Restart)
* animationProprierties | Animation name, Animation time, Animation tween (Sample: animation 1s ease-in )
@Papacidero
Papacidero / css3_animation_iteraction.js
Created March 15, 2013 11:42
Jquery: CSS3 Animation Iteration
jQuery(document).ready(function($) {
//Documentation http://www.sitepoint.com/css3-animation-javascript-event-handlers/
// W3C STANDARD
// animationstart
// animationiteration
// animationend