Skip to content

Instantly share code, notes, and snippets.

@alexanderGugel
alexanderGugel / .slate.js
Created September 18, 2015 16:20
.slate.js
slate.configAll({
'defaultToCurrentScreen': true,
'checkDefaultsOnLoad': true
});
var layout = {
maximize: S.op('move', {
'x' : 'screenOriginX',
'y' : 'screenOriginY',
'width' : 'screenSizeX',
[user]
name = Alexander Gugel
email = alexander.gugel@gmail.com
[alias]
lazy = !git add -A && git commit -m 'Too lazy for a commit message'
yolo = push origin master --force
back = revert HEAD
pom = !git pull origin master && git push origin master
shit = reset --hard HEAD
@alexanderGugel
alexanderGugel / .eslintrc
Created January 3, 2016 18:40
Almost Standard
{
"ecmaFeatures": {
"modules": true,
"experimentalObjectRestSpread": true
},
"env": {
"browser": false,
"es6": true,
"node": true
@alexanderGugel
alexanderGugel / ied-0.1.0
Created November 16, 2015 23:24
ied-0.1.0 vs npm-2.14.7 vs npm-3.4.0
.
├── node_modules
│   ├── 00963d697b2adf0c185c4e04e73174ba9b288eb2
│   │   ├── node_modules
│   │   │   └── xml-escape -> ../../00963d697b2adf0c185c4e04e73174ba9b288eb2/package
│   │   └── package
│   │   ├── LICENSE
│   │   ├── README.md
│   │   ├── index.js
│   │   ├── package.json
diff --git a/lib/module.js b/lib/module.js
index fb233d6..a2f6faa 100644
--- a/lib/module.js
+++ b/lib/module.js
@@ -103,20 +103,35 @@ function tryPackage(requestPath, exts, isMain) {
if (!pkg) return false;
var filename = path.resolve(requestPath, pkg);
+ var _filename = path.resolve(requestPath, '_' + pkg);
+
@alexanderGugel
alexanderGugel / index.html
Created July 10, 2014 05:44
Simple animated bar charts using D3 and data-attributes
<!DOCTYPE html>
<meta charset="utf-8">
<style>
.chart {
height: 70px;
width: 300px;
border-bottom: 1px solid #ccc;
display: block;
margin: 1em;
}
var fs = require('fs');
var words = fs.readFileSync('/usr/share/dict/words', {
encoding: 'utf8'
}).split('\n');
var tlds = ['co', 'com', 'io', 'de', 'it'];
var results = [];
@alexanderGugel
alexanderGugel / scraper.js
Created July 16, 2014 01:13
The Pirate Bay scraper
var request = require('request'),
_ = require('lodash');
// 100: Audio
// 200: Video
// 300: Applications
// 400: Games
// 500: Porn
// 600: Other
var categories = [100, 200, 300, 400, 500, 600];
@alexanderGugel
alexanderGugel / crawler.js
Created July 19, 2014 07:26
BitTorrent DHT Crawler
// This file is part of github.com/Trrnts/Trrnts - an upcoming alternative to The Pirate Bay.
var bencode = require('bencode'),
dgram = require('dgram'),
hat = require('hat'),
_ = require('lodash'),
redis = require('../redis')(),
geoip = require('geoip-lite');
// Put in a function. The returned function won't ever throw an error. This is
--- a.txt 2020-02-06 10:28:05.000000000 +0000
+++ b.txt 2020-02-06 10:28:22.000000000 +0000
@@ -1,5 +1,5 @@
module MyModule where
foo :: [Int] -> [Int]
-foo ints = map bar (map baz ints)
+foo ints = map (bar . baz) ints