Skip to content

Instantly share code, notes, and snippets.

View jaspervalero's full-sized avatar

Jasper Valero jaspervalero

View GitHub Profile
$ ignore osx > .gitignore # or path/to/.gitignore
# Created by https://www.gitignore.io
### OSX ###
.DS_Store
.AppleDouble
.LSOverride
# Icon must end with two \r
Icon
@jaspervalero
jaspervalero / gist:ca8ee62fdb10a50e4ec2
Created February 20, 2015 05:34
My custom dotfile function for gitignore.io
# Generate .gitignore file from gitignore.io API
# $@ - Comma separated list of templates to use, i.e. osx,sublimetext
# Common commands:
# 'ignore list' - List all currently supported templates
# 'ignore example1,example2' - Preview output in console
# 'ignore example1,example2 >> .gitignore' - Output to .gitignore file in CWD
# 'ignore example1,example2 >> ~/.gitignore' - Output to global .gitignore
function ignore() {
curl -s https://www.gitignore.io/api/$@ ;
}
$ echo "function gi() { curl -L -s https://www.gitignore.io/api/\$@ ;}" >> ~/.bash_profile && source ~/.bash_profile
$ echo "function gi() { curl -L -s https://www.gitignore.io/api/\$@ ;}" >> ~/.zshrc && source ~/.zshrc
@jaspervalero
jaspervalero / Gruntfile.js
Created October 13, 2014 02:31
Gruntfile.js w/ Mocha, Phantom.js, LiveReload (Code Example)
module.exports = function( grunt ) {
var port = 8981;
// Task config
grunt.initConfig({
pkg: grunt.file.readJSON( 'package.json' ),
clean: {
files: [ 'dist' ]
},
@jaspervalero
jaspervalero / Quick API Proxy
Last active December 18, 2015 11:49
PHP | Quick API Proxy
<?php
// Get query string
$queryString = $_SERVER['QUERY_STRING'];
// Get requested search term
$requestURL = 'https://apib4.blinkx.com/api.php?' . $queryString;
// Get XML from API
$json = callAPI( $requestURL );
header( 'Access-Control-Allow-Origin: *' );
@jaspervalero
jaspervalero / Log JSON
Created June 13, 2013 03:48
JS | Log object in JSON format to the console
console.log( 'JSON:', JSON.stringify( jsonObject, null, 4 ) );
@jaspervalero
jaspervalero / Zipcode to WOEID Converter in AS3 (Yahoo API)
Created February 26, 2012 09:11
AS3 | This is a zipcode to Where On Earth ID (WOEID) converter class which allows you to query weather and map results by zipcode. Soon the Yahoo API will no longer support direct requests by zipcode, and will only accept requests by WOEID. This class will ensu
package com.jaspervalero.tools
{
/*######################################
# Yahoo Zipcode to WOEID Converter #
# Written By: Jasper Valero #
# www.jaspervalero.com #
# July 13th, 2011 #
######################################*/
import flash.events.Event;