Skip to content

Instantly share code, notes, and snippets.

@rclai
rclai / react-native-ble test index.ios.js
Last active April 27, 2016 23:07
A test use of react-native-ble
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 October 15, 2015 13:04 — 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.
/*
* 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 January 30, 2023 15:20
Flexible example of Meteor.wrapAsync
// 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 August 10, 2015 19:49
Recursive function that cleans up Three.js rendering
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 August 29, 2015 14:12
Pretty common Meteor Packages that I use
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
@rclai
rclai / designer.html
Last active August 29, 2015 14:11
designer
<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 October 21, 2013 00:35
CSS Cross-Browser Opacity
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=95)";
filter: alpha(opacity=95);
opacity: .95;
@rclai
rclai / javascript_resources.md
Created October 21, 2013 00:34 — forked from jookyboi/javascript_resources.md
Here are a set of libraries, plugins and guides which may be useful to your Javascript coding.

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 October 21, 2013 00:34 — forked from jookyboi/css_resources.md
CSS libraries and guides to bring some order to the chaos.

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 October 21, 2013 00:33
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console