Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Gabes Mak pixelbreaker

🏠
Working from home
View GitHub Profile
@pixelbreaker
pixelbreaker / handbrake-shifter.ino
Last active Aug 17, 2020
Logitech pedal-handbrake and shifter arduino combo
View handbrake-shifter.ino
#include <Joystick.h>
// include library from https://github.com/MHeironimus/ArduinoJoystickLibrary
// Create the Joystick
Joystick_ Joystick(JOYSTICK_DEFAULT_REPORT_ID, JOYSTICK_TYPE_GAMEPAD, 8, 0, false, false, false, false, false, false, false, true, false, false, false);
#define HS_XAXIS_12 400
#define HS_XAXIS_56 600
#define HS_YAXIS_135 800
#define HS_YAXIS_246 300
View contentful-slug-title-subtitle.html
<!doctype html>
<head>
<link href="https://static.contentful.com/app/main-62e0abc7.css" media="all" rel="stylesheet" type="text/css">
<link href="https://static.contentful.com/app/vendor-976872d7.css" media="all" rel="stylesheet" type="text/css">
<link href="https://contentful.github.io/ui-extensions-sdk/cf-extension.css" media="all" rel="stylesheet" type="text/css">
<script type="text/javascript" src="https://unpkg.com/contentful-ui-extensions-sdk@3"></script>
</head>
<div class="widget-slug-editor">
<input id="slug" type="text" class="form-control" style="width: 98%; font-size: 14px">
<i id="error" class="fa fa-exclamation-triangle is-slug-duplicate"></i>
@pixelbreaker
pixelbreaker / example.js
Last active Mar 2, 2017
PouchDB image cache
View example.js
import ImageCache from './image-cache.js'
var imageCache = new ImageCache();
var img = $(el).find('img');
imageCache.loadImage(img[0], img.attr('src'));
@pixelbreaker
pixelbreaker / cors.js
Created Feb 9, 2016
Node Express cors proxy route
View cors.js
var request = require('request');
app.all(/^\/cors\/(.*)$/, function (req, res, next) {
// Set CORS headers: allow all origins, methods, and headers: you may want to lock this down in a production environment
res.header("Access-Control-Allow-Origin", "*");
res.header("Access-Control-Allow-Methods", "GET, PUT, PATCH, POST, DELETE");
res.header("Access-Control-Allow-Headers", req.header('access-control-request-headers'));
if (req.method === 'OPTIONS') {
// CORS Preflight
@pixelbreaker
pixelbreaker / leaflet-bing-ordnance-survey.js
Last active Nov 3, 2015 — forked from alexnorton/leaflet-bing-ordnance-survey.js
Use Bing Maps Ordnance Survey tiles as a Leaflet TileLayer
View leaflet-bing-ordnance-survey.js
var BingLayer = L.TileLayer.extend({
getTileUrl: function (tilePoint) {
this._adjustTilePoint(tilePoint);
return L.Util.template(this._url, {
s: this._getSubdomain(tilePoint),
q: this._quadKey(tilePoint.x, tilePoint.y, this._getZoomForUrl())
});
},
_quadKey: function (x, y, z) {
var quadKey = [];
View gist:3810631
1 Oct 10:52:00 - Starting server on port: 8001
[2012-10-01 10:52:00.323] [INFO] main - PushSocket listening on httpServer with 2 transports
[2012-10-01 10:52:00.335] [INFO] main - ResourceStreamClient connecting to: http://localhost:5001/api/v1
File "compiledjs/modules/modal_dialogs.js" created.
[2012-10-01 10:52:00.352] [INFO] main - ResourceStreamClient connection failed to: http://localhost:5001/api/v1
[2012-10-01 10:52:00.354] [INFO] main - Reconnecting stream for http://localhost:5001/api/v1 in 1ms
[2012-10-01 10:52:00.355] [INFO] main - Reconnecting stream for http://localhost:5001/api/v1 now
[2012-10-01 10:52:00.366] [INFO] main - ResourceStreamClient connection failed to: http://localhost:5001/api/v1
[2012-10-01 10:52:00.366] [INFO] main - Reconnecting stream for http://localhost:5001/api/v1 in 2ms
[2012-10-01 10:52:00.377] [INFO] main - Reconnecting stream for http://localhost:5001/api/v1 now
@pixelbreaker
pixelbreaker / gist:3742614
Created Sep 18, 2012
Error on asset conversion
View gist:3742614
Error handling request: HTTPError: 500 Internal Server Error
Error uploading file to the Asset Server (unknown_error)
at Class.<anonymous> (/Users/gabriel/Work/dharmafly/DRUM/drum/collaboration-api/lib/upload_server.coffee:91:27)
at Class.emit (events.js:67:17)
at respond (/Users/gabriel/Work/dharmafly/DRUM/drum/collaboration-api/node_modules/drum-asset-converter/lib/model/baseConverterClass.js:66:13)
at Object._onTimeout (/Users/gabriel/Work/dharmafly/DRUM/drum/collaboration-api/node_modules/drum-asset-converter/lib/model/baseConverterClass.js:92:31)
at Timer.ontimeout (timers.js:94:19)
View gist:3634949
$ ./script/start --watch --debug --deploy
Error: Cannot find module './daemon.v0.6.16'
at Function._resolveFilename (module.js:332:11)
at Function._load (module.js:279:25)
at Module.require (module.js:354:17)
at require (module.js:370:17)
at Object.<anonymous> (/Users/gabriel/Work/dharmafly/DRUM/drum/node_modules/forever/node_modules/daemon/lib/daemon.js:12:11)
at Module._compile (module.js:441:26)
at Object..js (module.js:459:10)
at Module.load (module.js:348:31)
You can’t perform that action at this time.