Skip to content

Instantly share code, notes, and snippets.

Avatar

Richard Lai rclai

  • Fintech
View GitHub Profile
@rclai
rclai / react-native-ble test index.ios.js
Last active Apr 27, 2016
A test use of react-native-ble
View react-native-ble test index.ios.js
import React, {
AppRegistry,
Component,
StyleSheet,
Text,
View
} from 'react-native';
import { Buffer } from 'buffer';
import RNBLE from 'react-native-ble';
@rclai
rclai / StandardFirmataForATH0.ino
Last active Oct 15, 2015 — forked from edgarsilva/StandardFirmataForATH0.ino
Modified firmata protocol that works on the arduino YUN linux side communicating to the arduino side using the ttyATH0 serialport interface.
View StandardFirmataForATH0.ino
/*
* Firmata is a generic protocol for communicating with microcontrollers
* from software on a host computer. It is intended to work with
* any host computer software package.
*
* To download a host software package, please clink on the following link
* to open the download page in your default browser.
*
* http://firmata.org/wiki/Download
*/
@rclai
rclai / meteor-wrapAsync.js
Last active Sep 17, 2020
Flexible example of Meteor.wrapAsync
View meteor-wrapAsync.js
// Thanks @trusktr
var requestSync = Meteor.wrapAsync(function(url, callback) {
request(url, function(error, response, body) {
callback(error, {response: response, body: body})
})
});
var result = requestSync("http://google.com");
console.log(result.response, result.body);
@rclai
rclai / gist:13635dbf5ecc05502c85
Created Aug 10, 2015
Recursive function that cleans up Three.js rendering
View gist:13635dbf5ecc05502c85
function doDispose (obj) {
if (obj !== null) {
for (var i = 0; i < obj.children.length; i++) {
doDispose(obj.children[i]);
}
if (obj.geometry) {
obj.geometry.dispose();
obj.geometry = undefined;
}
if (obj.material) {
@rclai
rclai / meteorAddCommand
Last active Aug 29, 2015
Pretty common Meteor Packages that I use
View meteorAddCommand
meteor add iron:router aldeed:collection2 aldeed:autoform matb33:collection-hooks dburles:collection-helpers momentjs:moment twbs:bootstrap less accounts-password ian:accounts-ui-bootstrap-3 meteorhacks:fast-render meteorhacks:subs-manager manuelschoebel:ms-seo ongoworks:speakingurl
View designer.html
<link rel="import" href="../core-scaffold/core-scaffold.html">
<link rel="import" href="../core-header-panel/core-header-panel.html">
<link rel="import" href="../core-menu/core-menu.html">
<link rel="import" href="../core-item/core-item.html">
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<link rel="import" href="../core-menu/core-submenu.html">
<link rel="import" href="../google-map/google-map.html">
<polymer-element name="my-element">
@rclai
rclai / opacity.css
Created Oct 21, 2013
CSS Cross-Browser Opacity
View opacity.css
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=95)";
filter: alpha(opacity=95);
opacity: .95;
@rclai
rclai / javascript_resources.md
Created Oct 21, 2013 — forked from jookyboi/javascript_resources.md
Here are a set of libraries, plugins and guides which may be useful to your Javascript coding.
View javascript_resources.md

Libraries

  • jQuery - The de-facto library for the modern age. It makes things like HTML document traversal and manipulation, event handling, animation, and Ajax much simpler with an easy-to-use API that works across a multitude of browsers.
  • Backbone - Backbone.js gives structure to web applications by providing models with key-value binding and custom events, collections with a rich API of enumerable functions, views with declarative event handling, and connects it all to your existing API over a RESTful JSON interface.
  • AngularJS - Conventions based MVC framework for HTML5 apps.
  • Underscore - Underscore is a utility-belt library for JavaScript that provides a lot of the functional programming support that you would expect in Prototype.js (or Ruby), but without extending any of the built-in JavaScript objects.
  • lawnchair - Key/value store adapter for indexdb, localStorage
@rclai
rclai / css_resources.md
Created Oct 21, 2013 — forked from jookyboi/css_resources.md
CSS libraries and guides to bring some order to the chaos.
View css_resources.md

Libraries

  • 960 Grid System - An effort to streamline web development workflow by providing commonly used dimensions, based on a width of 960 pixels. There are two variants: 12 and 16 columns, which can be used separately or in tandem.
  • Compass - Open source CSS Authoring Framework.
  • Bootstrap - Sleek, intuitive, and powerful mobile first front-end framework for faster and easier web development.
  • Font Awesome - The iconic font designed for Bootstrap.
  • Zurb Foundation - Framework for writing responsive web sites.
  • SASS - CSS extension language which allows variables, mixins and rules nesting.
  • Skeleton - Boilerplate for responsive, mobile-friendly development.

Guides

@rclai
rclai / 0_reuse_code.js
Created Oct 21, 2013
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
You can’t perform that action at this time.