Skip to content

Instantly share code, notes, and snippets.

@Fake51
Fake51 / GPG gems
Last active December 28, 2018 13:44
GPG gems
## use gpg2 instead of gpg
alias gpg=gpg2
## import key
gpg --import <keyfile>
## export public key
gpg --export --armor --output <outputfile> <key>
## export private key
module.exports = {
"env": {
"browser": true,
"es6": true,
"amd": true,
"mocha": true,
"node": true,
"jquery": true,
"commonjs": true,
},
@Fake51
Fake51 / babel react webpack build
Last active January 27, 2019 14:39
babel react webpack build
#package.json
{
"dependencies": {
"@babel/core": "^7.2.2",
"@babel/preset-env": "^7.3.1",
"@babel/preset-react": "^7.0.0",
"autoprefixer": "^9.4.6",
"babel-loader": "^8.0.5",
"css-loader": "^2.1.0",
"mini-css-extract-plugin": "^0.5.0",
# usage
npm run compile
# package.json
{
"devDependencies": {
"babel-core": "^6.14.0",
"babel-loader": "^6.2.5",
"babel-plugin-transform-runtime": "^6.12.0",
@Fake51
Fake51 / Frontend work
Last active December 12, 2015 14:35
Javascript libraries
js libraries
- Promises: bluebird
- DOM: lodash
- templating: t.js/mustache
- charts: smoothie charts
- responsive: W/mediatizr/Henka
- Events: events.js
- localstorage: strg.js
- sessionstorage: strg.js
- cookies: strg.js
# verify that certificate and chain will work
openssl verify -verbose -purpose sslserver -CAfile <file containing both root and intermediates> <file containing signed cert>
# verify that private key and certificate match - compare output
openssl x509 -noout -modulus -in server.crt | openssl md5
openssl rsa -noout -modulus -in server.key | openssl md5
# connect to web server and verify certificate
openssl s_client -connect example.com:443 -CApath /etc/ssl/certs/
Serious, this is messed up. That browsers get something so simple wrong is mindnumbing. Anyway, solution is:
Content-Disposition: attachment; filename="[ascii-only-filename]"; filename*=UTF-8''[urlencoded-utf8-filename]]
@Fake51
Fake51 / Infoscreen autostart for raspberry pi
Last active June 14, 2016 05:19
Raspbian: autostart browser on desktop init
# edit this file to add what you want to startup on desktop init
# /etc/xdg/lxsession/LXDE/autostart
#
# grabbed from http://alexba.in/blog/2013/01/07/use-your-raspberrypi-to-power-a-company-dashboard/
@lxpanel --profile LXDE
@pcmanfm --desktop --profile LXDE
#@xscreensaver -no-splash
# avoid screensaver/shut off on no activity

Install Graphite on Ubuntu or Debian in a VirtualEnv

Note

This guide is for Graphite 0.9.10 and Debian 7.

Preparations

@Fake51
Fake51 / Web project composer setup
Last active December 17, 2015 06:19
Base web project composer setup
{
"name": "fake51/composer",
"description": "Base web-project composer setup",
"config": {
"bin-dir": "bin"
},
"autoload": {
"psr-0": {
"": "src"
}