Skip to content

Instantly share code, notes, and snippets.

Avatar

Senica Gonzalez senica

View GitHub Profile
@senica
senica / jsdom-load.js
Created Jun 30, 2017
JSDOM simplification for loading scripts
View jsdom-load.js
/**
* If you are use to pre-version 10 jsdom, post 10 is an absolute nuisance for loading scripts...especially when you just
* want to test some code.
* This just creates a nice little wrapper to simplify everythign.
**/
const __jsdom = require("jsdom");
const { JSDOM } = __jsdom;
global.jsdom = function(html = '', scripts = []){
return new Promise((resolve, reject)=>{
@senica
senica / mocha-async.js
Created Jun 30, 2017
Allow async/await on mocha it handler.
View mocha-async.js
/**
* If you do:
* describe('Test', ()=>{
* it('what', async (done)=>{
* try{
* await SOME_ASYNC_FUNCTION
* done()
* }catch(e){
* done(e)
* }
@senica
senica / dev.conf
Created Jun 29, 2017 — forked from fnando/dev.conf
Nginx configuration for SSH tunnel
View dev.conf
upstream tunnel {
server 127.0.0.1:3000;
}
server {
listen 80;
server_name dev.codeplane.com br.dev.codeplane.com;
location / {
proxy_set_header X-Real-IP $remote_addr;
@senica
senica / riot+compiler+prevent+unmount.js
Last active Sep 28, 2016
Example to prevent unmount of tags using e.preventDefault
View riot+compiler+prevent+unmount.js
/* Riot WIP, @license MIT */
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
typeof define === 'function' && define.amd ? define(factory) :
(global.riot = factory());
}(this, (function () { 'use strict';
var __VIRTUAL_DOM = [];
var __TAG_IMPL = {};
var GLOBAL_MIXIN = '__global_mixin';
@senica
senica / riot+compiler+deferred+unmount.js
Last active Sep 28, 2016
Example using deferred unmount for riotjs
View riot+compiler+deferred+unmount.js
/* Riot WIP, @license MIT */
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
typeof define === 'function' && define.amd ? define(factory) :
(global.riot = factory());
}(this, (function () { 'use strict';
var __VIRTUAL_DOM = [];
var __TAG_IMPL = {};
var GLOBAL_MIXIN = '__global_mixin';
@senica
senica / trix.tag
Last active May 24, 2016
RiotJS wrapper for the Trix text editor
View trix.tag
<trix>
<input id={'trix-'+_riot_id} value={opts.content} type="hidden" />
<trix-editor name="trix" class="trix-content" input={'trix-'+_riot_id} ></trix-editor>
<script>
/*
* <trix trix-change={changetext} content={content}></trix>
* You can bind to any of the trix events
*/
this.on('mount', function(){
View rate.js
<rate>
<div class={"thumbs-wrapper " + (rating > 0 ? 'up' : rating < 0 ? 'down' : '')}>
<button class="down icon-thumbs-down"></button>
<button class="up icon-thumbs-up"></button>
</div>
<style scoped>
button{
min-width: auto;
min-height: auto;
@senica
senica / Water Sensors.ino
Created Jun 3, 2013
Shubra Qubala IT Project - Water Sensor code for the Arduino processor
View Water Sensors.ino
/*
Allebrum, LLC (www.allebrum.com)
Senica Gonzalez - senica@gmail.com
Manual for packet assembly and options can be found here:
ftp1.digi.com/support/documentation/90000976_M.pdf
ultrasonic module ping distance sensor
VCC to arduino 5v GND to arduino GND
Echo to Arduino pin 3; Trig to Arduino pin 4
@senica
senica / uglyccc.css
Created Mar 25, 2015
CCC Content Managment Fix
View uglyccc.css
@charset "utf-8";*,html{-webkit-tap-highlight-color:transparent}.tp-bullets.preview4 .bullet,hr{-webkit-box-sizing:content-box;-moz-box-sizing:content-box}.caret:before,.glyphicon{-moz-osx-font-smoothing:grayscale}.glyphicon,.mistbtn-circle,.mistbtn-rounded,sub,sup{position:relative}.input-group-addon:last-child,.panel>.table-bordered>tbody>tr>td:first-child,.panel>.table-bordered>tbody>tr>th:first-child,.panel>.table-bordered>tfoot>tr>td:first-child,.panel>.table-bordered>tfoot>tr>th:first-child,.panel>.table-bordered>thead>tr>td:first-child,.panel>.table-bordered>thead>tr>th:first-child,.panel>.table-responsive>.table-bordered>tbody>tr>td:first-child,.panel>.table-responsive>.table-bordered>tbody>tr>th:first-child,.panel>.table-responsive>.table-bordered>tfoot>tr>td:first-child,.panel>.table-responsive>.table-bordered>tfoot>tr>th:first-child,.panel>.table-responsive>.table-bordered>thead>tr>td:first-child,.panel>.table-responsive>.table-bordered>thead>tr>th:first-child{border-left:0}.navbar-fixed-bottom .na
@senica
senica / uglyccc.ie8.css
Created Mar 25, 2015
CCC Content Management Fixes
View uglyccc.ie8.css
@charset "utf-8";.fixed-header,.page-box{padding-top:0!important}.carousel-box .prev,.header .cart-header .dropdown-menu .product-remove,.header .cart-header .dropdown-toggle .icon,.jslider .jslider-pointer{background-repeat:no-repeat;background-position:50% 50%}.fixed-header{margin-top:0!important}.fixed-header .header,.fixed-header.hidden-top.visible-top .header{-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;margin-top:inherit;position:static;top:inherit;-webkit-backface-visibility:inherit;-webkit-transform:inherit}.fixed-header.hidden-top{-webkit-transition:all 0 linear;transition:all 0 linear}.fixed-header.hidden-top #top-box{margin-top:0;position:static}.fixed-header.hidden-top .header{margin-top:0;position:inherit}.fixed-header.fixed .header,.fixed-header.hidden-top.visible-top .header{border-bottom:1px solid #e1e1e1}.gallery-images:hover>.bg-images{filter:alpha(opacity=70)}.work:hover .bg-hover{filter:alpha(opacity=90)}.carousel-box .prev{background-image:url(../../img/png-icons/arrow-lef