Skip to content

Instantly share code, notes, and snippets.

View kyuumeitai's full-sized avatar

Álex Acuña Viera kyuumeitai

View GitHub Profile
@kyuumeitai
kyuumeitai / hack.sh
Created November 30, 2012 15:33 — forked from erikh/hack.sh
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/2108403/hack.sh | sh
#
@jcinis
jcinis / jquery.append.js
Created March 15, 2013 16:00
jQuery plugin to add event triggering to dom elements anytime they append or are appended. The reason for creating this is was to allow backbone.js views to be aware of their being added to the dom and to trigger post-render functionality.
/**
* Adds event triggering whenever an append takes place.
*
* - Parent is given an "append" trigger with the child as an arguement
* - Child is given an "appended" trigger with the parent as an argument
*
* @author Jessey White-Cinis <[email protected]>
*/
(function($) {
var jqueryAppend = $.fn.append;
@passy
passy / yeoman_compass.md
Last active August 2, 2024 09:52
Using Yeoman with Compass Sprites

Yeoman + Compass Sprites

Setup

generator-webapp has support for compass out of the box. However, in order to use one of my favorite features of it — sprites and the image_url helper — you have to make some adjustments to the Gruntfile.

Let's assume you use a SASS stylesheet like this one:

@import "design/*.png"
@raae
raae / main.js
Last active August 29, 2015 13:59
Moment Timzone Support in Parse.com Cloud
// Read full blogpost explaining this at http://labs.lillyapps.no/2014/04/12/handle-timezones-parse-com
var moment = require('cloud/moment-timezone.js');
moment.tz.add(require('cloud/moment-timezone-data.js'));
Parse.Cloud.define("momentTest", function (request, response)
{
var osloSummerTime = moment.tz('2014-04-12 11:55', 'Europe/Oslo');
var osloWinterTime = moment.tz('2013-11-18 11:55', 'Europe/Oslo');
@jgoux
jgoux / app.js
Created April 15, 2014 14:53
Ionic / AngularJS service wrapper for Web SQL API / SQLite-Cordova-Plugin
angular.module('myApp', ['ionic', 'myApp.services', 'myApp.controllers'])
.run(function(DB) {
DB.init();
});
@micc83
micc83 / skip-to-check-out.php
Last active October 28, 2024 06:18
Skip cart and redirect to direct checkout on WooCommerce
<?php
/**
* Skip cart and redirect to direct checkout
*
* @package WooCommerce
* @version 1.0.0
* @author Alessandro Benoit
*/
// Skip the cart and redirect to check out url when clicking on Add to cart
@tmocellin
tmocellin / React Scroll Event
Created August 3, 2015 14:05
Handle the scroll event in react js and change the navbar class when special section is on top of windows
var Hello = React.createClass({
getOffset : function(element){
var bounding = element.getBoundingClientRect();
return {
top: bounding.top + document.body.scrollTop,
left: bounding.left + document.body.scrollLeft
};
},
@thegitfather
thegitfather / vanilla-js-cheatsheet.md
Last active May 20, 2025 11:56
Vanilla JavaScript Quick Reference / Cheatsheet
@punchi
punchi / validar_rut.php
Last active May 12, 2021 19:13 — forked from ricardodbv/validar_rut.php
Validar Rut en php
<?php
/**
* Comprueba si el rut ingresado es valido
* @param string $rut RUT
* @return boolean
*/
public function valida_rut($rut)
{
if (!preg_match("/^[0-9.]+[-]?+[0-9kK]{1}/", $rut)) {
@corysimmons
corysimmons / package.json
Created June 23, 2016 21:07
babel, sass, npm-run-all
{
"devDependencies": {
"babel-cli": "^6.10.1",
"babel-preset-es2015": "^6.9.0",
"babel-preset-stage-0": "^6.5.0",
"node-sass": "^3.8.0",
"npm-run-all": "^2.2.2"
},
"babel": {
"presets": [