Skip to content

Instantly share code, notes, and snippets.

Roy Riojas royriojas

Block or report user

Report or block royriojas

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@royriojas
royriojas / cloudSettings
Last active Jul 29, 2019
Visual Studio Code Settings Sync Gist
View cloudSettings
{"lastUpload":"2019-07-29T06:25:03.264Z","extensionVersion":"v3.4.1"}
@royriojas
royriojas / commands.bash
Created Nov 25, 2018
Fix cannot find driver - Creative SoundBlaster Omni Control Panel issue
View commands.bash
# If you receive the following error while trying to open the Creative SoundBlaster Omni Control Panel
#
# ==============================================================
# Cannot start the app because the audio driver cannot be found
# ==============================================================
# then this is the solution:
# In the command line execute:
#
sudo kextload -b com.Creative.driver.TruStudioPCUSBAudioPlugin
View rulers.js
$(`<script src="//code.jquery.com/ui/1.12.1/jquery-ui.min.js"
integrity="sha256-VazP97ZCwtekAsvgPBSUwPFKdrwD3unUfSGVYrahUqU="
crossorigin="anonymous"></script>`).appendTo('head')
$(`<link href="//cdnjs.cloudflare.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.css" rel="stylesheet" type="text/css" />`).appendTo('head');
var createBox = () => {
const w = 100;
const h = 100;
const style = `
@royriojas
royriojas / example.js
Created Oct 27, 2015
async/await example
View example.js
function isValidEmail(email) {
return email.match(/^[^\s@]+@[^\s@]+\.[^\s@]+$/);
}
function getUserByEmail(email) {
return new Promise((resolve) => {
setTimeout(() => {
// keep rejections for exceptions only
if (email !== 'roy@someemail.com') {
return resolve(null);
@royriojas
royriojas / index.js
Created Oct 16, 2015
requirebin sketch
View index.js
// require() some stuff from npm (like you were using browserify)
// and then hit Run Code to run it on the right
var $ = require('jquery');
$(function () { $('body').append('<p>Hello world from app here!</p>'); })
View npm-i.txt
npm i
> chokidar@0.8.1 postinstall /Users/roy/tmp/eslint/node_modules/beefy/node_modules/chokidar
> node setup-deps.js
Executing npm install fsevents@0.1.6 recursive-readdir@0.0.2
npm WARN package.json chokidar@0.8.1 No license field.
../nodefsevents.cc:31:30: error: expected class name
class NodeFSEvents : node::ObjectWrap {
^
@royriojas
royriojas / install-package.sh
Created Aug 18, 2015
Install package with npm from github using the tarball directly
View install-package.sh
npm i --save https://github.com/:username/:reponame/tarball/:branchname
# Via http://package.json.nodejitsu.com/
@royriojas
royriojas / index.js
Created Aug 15, 2015
requirebin sketch
View index.js
var Tap = require( 'tap.js' );
var $ = require( 'jquery' );
var tap = new Tap( document );
require( 'document-register-element/build/document-register-element.js' );
//var escape = require('escape-html');
var btn = document.querySelector( 'button' );
btn.addEventListener( 'tap', function ( e ) {
console.log( 'tap, tap', e.target );
} )
@royriojas
royriojas / index.js
Created Jul 28, 2015
requirebin sketch
View index.js
var data = window.jsonData;
var $ = require('jquery');
var React = require('react/addons');
var throttle = require('throttly');
var rand = function rand() {
var min, max,
args = arguments;
//if only one argument is provided we are expecting to have a value between 0 and max
if ( args.length === 1 ) {
max = args[ 0 ];
@royriojas
royriojas / index.js
Last active Aug 29, 2015
requirebin sketch
View index.js
var $ = require('jquery');
$(function () {
var React = require('react/addons');
var throttle = require('throttly');
var rand = function rand() {
var min, max,
args = arguments;
//if only one argument is provided we are expecting to have a value between 0 and max
You can’t perform that action at this time.