Skip to content

Instantly share code, notes, and snippets.

View chmanie's full-sized avatar
🦦

Christian Maniewski chmanie

🦦
View GitHub Profile
@scharf
scharf / app-ntest.js
Created April 2, 2015 14:35
require all tests
'use strict';
// to get intellij navigation correctly, we need
// static imports. Therefore we dynamically create
// a test file that imports all tests we want to run...
var globule = require('globule');
var path = require('path');
var fs = require('fs');
@ericelliott
ericelliott / .eslintrc
Last active June 19, 2017 16:03
ES6 Lint
{
"env": {
"browser": true,
"node": true,
"es6": true
},
"ecmaFeatures": {
"jsx": true,
"superInFunctions": false,
@shaond
shaond / proxy.js
Last active June 27, 2018 11:28
Node.js code to proxy an upstream webpage using cheerio
var http = require('http');
var express = require('express');
var router = express.Router();
/* GET users listing. */
router.get('/', function(req, res) {
var request = require('request');
var url = req.query.url;
@adrianbravo
adrianbravo / encrypt-decrypt.js
Created September 22, 2011 00:08
Basic Node.js crypto cipher/decipher example.
var crypto = require('crypto')
, key = 'salt_from_the_user_document'
, plaintext = 'password'
, cipher = crypto.createCipher('aes-256-cbc', key)
, decipher = crypto.createDecipher('aes-256-cbc', key);
cipher.update(plaintext, 'utf8', 'base64');
var encryptedPassword = cipher.final('base64')
decipher.update(encryptedPassword, 'base64', 'utf8');
@hew
hew / _readme.md
Last active June 10, 2022 19:13
Operator Mono w/ Italics on OSX VIm

Operator Mono w/ Italics on OSX Vim

@riskable
riskable / main.rs
Last active November 20, 2022 23:20
Multi-core Rust example on rp2040 with RTIC (on one core)
// This is just a subsection of the code (the parts relevant to multi-core stuff)
// It won't "just work"
use rp2040_hal as hal;
use hal::multicore::{Multicore, Stack};
use hal::pac;
use hal::sio::Sio;
use heapless::spsc::Queue;
// These are markers are used to indicate the beginning and end
@dalegaspi
dalegaspi / brew_symlink_error_sierra.md
Last active January 4, 2024 22:32
Homebrew Symlink errors in Mac OSX High Sierra
@cmod
cmod / minimal_fb_messenger.css
Last active July 2, 2024 13:32
Minimal Facebook Messenger for Fluid
/*
Minimal Facebook Messenger
==========================
1. Make a Fluid (http://fluidapp.com/) instance of https://facebook.com/messages/
1. a. (You need to buy the paid version of Fluid to modify UserStyles)
2. Apply the below CSS as a Userstyles stylesheet
3. Like magic, you can now message without all the cruft of Full Facebook
@nl5887
nl5887 / transfer.fish
Last active July 30, 2024 09:21
Bash and zsh alias for transfer.sh. Transfers files and directories to transfer.sh.
function transfer
if test (count $argv) -eq 0
echo "No arguments specified. Usage:\necho transfer /tmp/test.md\ncat /tmp/test.md | transfer test.md"
return 1
end
## get temporarily filename, output is written to this file show progress can be showed
set tmpfile ( mktemp -t transferXXX )
## upload stdin or file
@justmoon
justmoon / custom-error.js
Last active November 19, 2024 02:40 — forked from subfuzion/error.md
Creating custom Error classes in Node.js
'use strict';
module.exports = function CustomError(message, extra) {
Error.captureStackTrace(this, this.constructor);
this.name = this.constructor.name;
this.message = message;
this.extra = extra;
};
require('util').inherits(module.exports, Error);