Skip to content

Instantly share code, notes, and snippets.

@learningjs
learningjs / forge run web error - console
Created July 18, 2012 01:22
forge run web error - console
forge run web
[ INFO] Forge tools running at version 3.3.5
[ INFO] Checking JavaScript files...
[ INFO] JavaScript check complete
[ INFO] Verifying your configuration settings...
[ INFO] Configuration settings check complete
[ ERROR] Something went wrong that we didn't expect:
[ ERROR] Failed when running npm: npm http GET https://registry.npmjs.org/express/2.5.0
npm http 200 https://registry.npmjs.org/express/2.5.0
npm http GET https://registry.npmjs.org/express/-/express-2.5.0.tgz
@learningjs
learningjs / forge blog mispelling
Created July 18, 2012 01:36
forge blog mispelling
http://trigger.io/cross-platform-application-development-blog/2012/04/30/how-to-build-hybrid-mobile-apps-combining-native-ui-components-with-html5/
Replace your existing src/config.json with this:
...
<strong>"topbar": true</strong>
...
http://trigger.io/cross-platform-application-development-blog/2012/03/02/how-to-build-fast-html5-mobile-apps-using-backbone-js-zepto-js-and-trigger-io/
/* passable motion blur effect using frame blending
* basically move your 'draw()' into 'sample()', time runs from 0 to 1
* by dave
* http://beesandbombs.tumblr.com
*/
int samplesPerFrame = 32; // more is better but slower. 32 is enough probably
int numFrames = 48;
float shutterAngle = 2.0; // this should be between 0 and 1 realistically. exaggerated for effect here
int[][] result;
void setup() {
size(500, 500);
noFill();
strokeWeight(3);
strokeJoin(BEVEL);
}
float th1, th2, r, x, y, t;
int N = 16;
@learningjs
learningjs / index.html
Created December 4, 2013 22:26
Slightly modified version of the provided demo : just added the angularjs script and a basic binding via a model input text . This is noticeably slow on my test device ( Samsung Note 2 )
<!DOCTYPE html>
<html ng-app>
<head>
<title>Hello, Mobile!</title>
<link rel="stylesheet" href="index.css" type="text/css" />
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.1/angular.js"></script>
</head>
<body>
<div>
<input type="text" ng-model="name" placeholder="Mobile">
@learningjs
learningjs / index.js
Created December 17, 2013 13:44 — forked from auser/index.js
var Pusher = require('pusher'),
os = require('os'),
express = require('express'),
app = express(),
ch = 'stats';
var pusher = new Pusher({
appId: process.env.PUSHER_APP_ID,
key: process.env.PUSHER_KEY,
secret: process.env.PUSHER_SECRET
@learningjs
learningjs / test.js
Created December 29, 2013 21:05
Code used to retrieve an user's watched repositories on Github. Always returns 30 results.
fetchJSONFile("https://api.github.com/users/" + userName + "/subscriptions", function(data){
...
}
function fetchJSONFile(path, callback) {
var httpRequest = new XMLHttpRequest();
httpRequest.onreadystatechange = function() {
if (httpRequest.readyState === 4) {
if (httpRequest.status === 200) {
var data = JSON.parse(httpRequest.responseText);
@learningjs
learningjs / gist:8287828
Created January 6, 2014 19:01
coursesites.com - genart_processing - Constellations Sketch Preface “Constellations have always been troublesome things to name. If you give one of them a fanciful name, it will always refuse to live up to it; it will always persist in not resembling the thing it has been named for. Ultimately, to satisfy the public, the fanciful name has to be …
// Gemini
// http://stardate.org/nightsky/constellations/gemini
void setup() {
// Sets sketch size
size(400, 400);
// Translates origin point (now "0, 0" are placed at "width / 5, height / 5" and not at upper left corner anymore)
translate(width / 5, height / 5);
// Sets background color
background(0);
@learningjs
learningjs / mickey.pde
Created January 6, 2014 21:08
Original Image - “Originality depends only on the character of the drawing and the vision peculiar to each artist.” – Georges Seurat
// Draws a Mickey
void setup() {
// Sets sketch size
size(600, 600);
// Translates origin point (now "0, 0" are placed at "width / 2, height / 2" and not at upper left corner anymore)
translate(width / 2, height / 2);
// Sets background color
background(200);
// Disables all smoothing
@learningjs
learningjs / AndroidManifest.xml
Last active January 4, 2016 15:39
activity Java files for the Jabberwocky and Roundball activities. AndroidManifest.xml and activity_jabberwocky.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="app.to.webpage.webpagetoapp"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="10"
android:targetSdkVersion="18" />
<uses-permission android:name="android.permission.INTERNET"/>