This file contains hidden or 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
#include <Adafruit_NeoPixel.h> | |
#ifdef __AVR__ | |
#include <avr/power.h> | |
#endif | |
#define NEOPIXEL_COUNT 4 | |
#define NEOPIXEL_PIN 4 | |
Adafruit_NeoPixel pixels = Adafruit_NeoPixel(NEOPIXEL_COUNT, NEOPIXEL_PIN, NEO_GRB + NEO_KHZ800); | |
unsigned int rgbColor[] {255, 0, 0}; | |
int decColor = 0; | |
This file contains hidden or 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
map $http_x_forwarded_proto $fcgi_https { | |
default off; | |
https on; | |
} | |
server { | |
// ... | |
location ~ \.php$ { | |
// ... | |
fastcgi_param HTTPS $fcgi_https; |
This file contains hidden or 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
./configure --with-http_ssl_module \ | |
--with-http_stub_status_module \ | |
--with-http_gzip_static_module \ | |
--with-pcre-jit \ | |
--with-ipv6 \ | |
--with-cc-opt='-O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2' \ | |
--with-ld-opt='-Wl,-Bsymbolic-functions -Wl,-z,relro' \ | |
--prefix=/usr/share/nginx \ | |
--sbin-path=/usr/sbin/nginx \ | |
--conf-path=/etc/nginx/nginx.conf \ |
This file contains hidden or 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 express = require('express'); | |
var app = express(); | |
var fabric = require('fabric').fabric; | |
var bodyParser = require('body-parser') | |
var urlencodedParser = bodyParser.urlencoded({extended: false}) | |
app.get('/', function (req, res) { | |
res.send('<script src="https://cdnjs.cloudflare.com/ajax/libs/fabric.js/1.4.0/fabric.min.js"></script><form action="/canvas" method="post" target="i" onsubmit="document.getElementById(\'json\').value = JSON.stringify(canvas.toJSON());console.log(canvas.toJSON())"><input type="hidden" name="json" id="json"><input type="submit" value="render" /></form><canvas id="c" width="200" height="200" style="border:1px solid #aaa"></canvas><iframe name="i" src="/404" style="height: 250px; width:250px;"></iframe><script>var canvas = new fabric.Canvas("c", {isDrawingMode: true})</script>'); | |
}); |
This file contains hidden or 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
#include <boost/fusion/include/adapt_struct.hpp> | |
#include <boost/fusion/include/for_each.hpp> | |
#include <iostream> | |
struct TestThing { | |
int bla; | |
char blabla[10]; | |
}; | |
BOOST_FUSION_ADAPT_STRUCT( | |
TestThing, |
This file contains hidden or 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
from PIL import Image | |
import random | |
import pylzma | |
for i in xrange(1000): | |
print i | |
img = Image.new("RGB", (16, 12)) | |
data = img.load() | |
for x in range(16): | |
for y in range(12): |
This file contains hidden or 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
for f in 41*.tga; do mv "$f" "`echo $f | sed s/41/46/`"; done |
This file contains hidden or 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
call "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\vcvars32.bat" | |
set INCLUDE=%ProgramFiles(x86)%\Microsoft SDKs\Windows\v7.1A\Include;%INCLUDE% | |
set PATH=%ProgramFiles(x86)%\Microsoft SDKs\Windows\v7.1A\Bin;%PATH% | |
set LIB=%ProgramFiles(x86)%\Microsoft SDKs\Windows\v7.1A\Lib;%LIB% | |
set CL=/D_USING_V110_SDK71_ /D_USING_V120_SDK71_ /D_WIN32_WINNT=0x0501 %CL% | |
set LINK=/SUBSYSTEM:WINDOWS,5.01 %LINK% |
This file contains hidden or 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
utf8() { for var; do (mv "$var" "$var.old" && iconv -f windows-1252 -t utf-8 "$var.old" > "$var" && rm -f "$var.old" && echo $var); done } |
This file contains hidden or 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
ALTER TABLE `x` DROP `id`; | |
ALTER TABLE `x` AUTO_INCREMENT = 1; | |
ALTER TABLE `x` ADD `id` int UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST; |