Skip to content

Instantly share code, notes, and snippets.

View pixelbreaker's full-sized avatar
🏩
rm -rf /

Gabes Mak pixelbreaker

🏩
rm -rf /
View GitHub Profile
@pixelbreaker
pixelbreaker / gist:5e3fb8fa95ce1133563454ec04ec3e6e
Last active July 14, 2022 22:55
Coding capslock symbols for Karabiner Elements complex modifications
{
"title": "Caps Lock Vim Movements (rev 2)",
"rules": [
{
"description": "CAPS › ESC, CAPS+H/J/K/L › ←↓↑→, CAPS+D/U › PG↓↑",
"manipulators": [
{
"conditions": [
{
"name": "caps_lock pressed",
@pixelbreaker
pixelbreaker / handbrake-shifter.ino
Last active August 17, 2020 08:39
Logitech pedal-handbrake and shifter arduino combo
#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
<!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 / cors.js
Created February 9, 2016 15:18
Node Express cors proxy route
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 / example.js
Last active March 2, 2017 16:13
PouchDB image cache
import ImageCache from './image-cache.js'
var imageCache = new ImageCache();
var img = $(el).find('img');
imageCache.loadImage(img[0], img.attr('src'));
@pixelbreaker
pixelbreaker / leaflet-bing-ordnance-survey.js
Last active November 3, 2015 12:41 — forked from alexnorton/leaflet-bing-ordnance-survey.js
Use Bing Maps Ordnance Survey tiles as a Leaflet TileLayer
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 = [];
@pixelbreaker
pixelbreaker / gist:3810631
Created October 1, 2012 09:53
Drum errors
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 September 18, 2012 11:15
Error on asset conversion
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)
@pixelbreaker
pixelbreaker / gist:3634949
Created September 5, 2012 10:52
daemon not found
$ ./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)