Skip to content

Instantly share code, notes, and snippets.

View joseluisq's full-sized avatar

Jose Quintana joseluisq

View GitHub Profile
// for demo: http://jsbin.com/jeqesisa/7/edit
// for detailed comments, see my SO answer here http://stackoverflow.com/questions/8853396/logical-operator-in-a-handlebars-js-if-conditional/21915381#21915381
/* a helper to execute an IF statement with any expression
USAGE:
-- Yes you NEED to properly escape the string literals, or just alternate single and double quotes
-- to access any global function or property you should use window.functionName() instead of just functionName()
-- this example assumes you passed this context to your handlebars template( {name: 'Sam', age: '20' } ), notice age is a string, just for so I can demo parseInt later
<p>
{{#xif " this.name == 'Sam' && this.age === '12' " }}

SSL upgrades on rubygems.org and RubyInstaller versions

Hello,

If you reached this page, means you've hit this SSL error when trying to pull updates from RubyGems:

SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed

This error is produced by changes in rubygems.org infrastructure, please

require(['app'], function (App) {
App.init();
});
//app.js
define([
'pages'
], function (pages) {
return {
init : function () {
@joseluisq
joseluisq / index.html
Last active August 29, 2015 14:24 — forked from pmanijak/index.html
<!doctype html>
<html ng-app="project">
<head>
<title>Angular: Service example</title>
<script src="http://code.angularjs.org/angular-1.0.1.js"></script>
<script>
var projectModule = angular.module('project',[]);
projectModule.factory('theService', function() {
return {
@joseluisq
joseluisq / .eslintrc
Last active August 29, 2015 14:26 — forked from cletusw/.eslintrc
ESLint Reset - A starter .eslintrc file that resets all rules to off and includes a description of what each rule does. From here, enable the rules that you care about by changing the 0 to a 1 or 2. 1 means warning (will not affect exit code) and 2 means error (will affect exit code).
{
// http://eslint.org/docs/rules/
"ecmaFeatures": {
"binaryLiterals": false, // enable binary literals
"blockBindings": false, // enable let and const (aka block bindings)
"defaultParams": false, // enable default function parameters
"forOf": false, // enable for-of loops
"generators": false, // enable generators
"objectLiteralComputedProperties": false, // enable computed object literal property names
@joseluisq
joseluisq / node_ssh2_transfer_dir.js
Last active October 11, 2015 00:53 — forked from mscdex/gist:c1a7199af2af9d3ceb1c
Transfer a directory over SSH with Node SSH2
var tar = require('tar-fs');
var zlib = require('zlib');
function transferDir(conn, remotePath, localPath, compression, cb) {
var cmd = 'tar cf - "' + remotePath + '" 2>/dev/null';
if (typeof compression === 'function')
cb = compression;
else if (compression === true)
compression = 6;
@joseluisq
joseluisq / gulpfile.js
Created November 3, 2015 07:17 — forked from cgmartin/gulpfile.js
Node ES6 istanbul, isparta, mocha-co gulpfile example
'use strict';
var gulp = require('gulp');
var del = require('del');
var mocha = require('gulp-mocha-co');
var istanbul = require('gulp-istanbul');
var isparta = require('isparta');
var coverageEnforcer = require('gulp-istanbul-enforcer');
var paths = {
server: {
@joseluisq
joseluisq / jquery-bootstrap-datepicker.css
Created February 15, 2016 16:49 — forked from miwahall/jquery-bootstrap-datepicker.css
jQuery UI Datepicker Bootstrap 3 Style
.ui-datepicker {
background-color: #fff;
border: 1px solid #66AFE9;
border-radius: 4px;
box-shadow: 0 0 8px rgba(102,175,233,.6);
display: none;
margin-top: 4px;
padding: 10px;
width: 240px;
}
@joseluisq
joseluisq / style_guide.md
Created February 19, 2016 22:50 — forked from dominictarr/style_guide.md
style guide

High level style in javascript.

Opinions are like assholes, every one has got one.

This one is mine.

Punctuation: who cares?

Punctuation is a bikeshed. Put your semicolons, whitespace, and commas where you like them.

@joseluisq
joseluisq / propel.yaml
Created March 18, 2016 19:24 — forked from cristianoc72/propel.yaml
Propel sample configuration file
## Sample Propel configuration file ##
propel:
## General settings ##
general:
# The name of your project.
# This affects names of generated files, etc.
project:
version: 2.0.0-dev