This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// in onCreate() | |
glSurfaceView = (GLSurfaceView) findViewById(R.id.surfaceView); | |
mGPUImage = new GPUImage(this); | |
mGPUImage.setGLSurfaceView(glSurfaceView); | |
// on user button click | |
mCamera.mCameraInstance.takePicture(null, null, new Camera.PictureCallback() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var five = require('johnny-five') | |
var board = new five.Board() | |
var moveBase = function(board, base, cb) { | |
base.to(10, 2000) | |
board.wait(2500, function () { | |
base.to(170, 3000) | |
board.wait(3500, function () { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/******************************************************** | |
* PID Basic Example | |
* Reading analog input 0 to control analog PWM output 3 | |
********************************************************/ | |
#include <PID_v1.h> | |
#define PIN_INPUT 0 | |
#define PIN_OUTPUT 3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Verifying that +ccharlesworth is my blockchain ID. https://onename.com/ccharlesworth |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.onoffswitch { | |
position: relative; width: 90px; | |
-webkit-user-select:none; -moz-user-select:none; -ms-user-select: none; | |
} | |
.onoffswitch-checkbox { | |
display: none; | |
} | |
.onoffswitch-label { | |
display: block; overflow: hidden; cursor: pointer; | |
border: 1px solid red; border-radius: 20px; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
passport.use(new MailChimpStrategy({ | |
clientID: config.auth.mailchimpAuth.clientID, | |
clientSecret: config.auth.mailchimpAuth.clientSecret, | |
callbackURL: config.auth.mailchimpAuth.callbackURL, | |
passReqToCallback : true | |
}, | |
function(req, token, refreshToken, profile, done) { | |
token = token + '-' + profile.dc; // Append datacenter to token for API calls to work | |
// Save and use token for doing Mailchimp API calls | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var result = {ok: true}; | |
console.dir(result, {depth: null, colors: true}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private float[] formatImageData() { | |
Bitmap bitmap = BitmapFactory.decodeResource(getResources(), imageResouceIds[imageArrayIndex]); | |
Bitmap scaledBitmap = Bitmap.createScaledBitmap(bitmap, 32, 32, true); | |
int[] intArray = new int[1024]; | |
scaledBitmap.getPixels(intArray, 0, 32, 0, 0, 32, 32); | |
float[] floatArray = new float[3072]; | |
int n = 0; | |
for (int i = 0; i < 1024; i++) { | |
floatArray[n++] = ((intArray[i] >> 16) & 0xff) / 255.0f; | |
floatArray[n++] = ((intArray[i] >> 8) & 0xff) / 255.0f; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alias firefox="open -a Firefox 'https://www.bbc.com' && open -a Firefox 'https://flipboard.com' && open -a Firefox 'https://twitter.com' && open -a Firefox 'http://producthunt.com' && open -a Firefox 'https://blog.codinghorror.com'" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var _lsTotal=0,_xLen,_x;for(_x in localStorage){ if(!localStorage.hasOwnProperty(_x)){continue;} _xLen= ((localStorage[_x].length + _x.length)* 2);_lsTotal+=_xLen; console.log(_x.substr(0,50)+" = "+ (_xLen/1024).toFixed(2)+" KB")};console.log("Total = " + (_lsTotal / 1024).toFixed(2) + " KB"); |