Skip to content

Instantly share code, notes, and snippets.

View dejanr's full-sized avatar

Dejan Ranisavljević dejanr

View GitHub Profile
@dejanr
dejanr / install.sh
Created October 24, 2015 20:05 — forked from cstrahan/install.sh
Install NixOS on Hetzner(PX60-SSD)
set -x
wget http://archive.zfsonlinux.org/debian/pool/main/z/zfsonlinux/zfsonlinux_2%7Ewheezy_all.deb
dpkg -i zfsonlinux_2~wheezy_all.deb
apt-get update
apt-get install -y debian-zfs
DISK_SIZE=$(parted /dev/sda unit MB print | grep '^Disk' | sed -r 's/.* ([0-9]+)MB.*/\1/')
# Partitions
@dejanr
dejanr / RepRap Suppliers in Europe Germany
Last active May 8, 2017 10:37
RepRap Suppliers in Europe/Germany
# RepRap Suppliers in Europe/Germany
- https://www.damencnc.com
- http://www.motedis.com/shop
- http://www.igus.eu/
- http://store.amberspyglass.co.uk/makerslide-500mm.html
- http://www.ratrig.com/
- http://www.watterott.com/de reseller for ratrig
- https://www.conrad.de/
@dejanr
dejanr / sorting kata
Last active December 4, 2015 10:28
JS
const combine = (...comparators) => (x, y) => comparators.reduce((prev, next) => prev || next(x, y), 0);
const comparators = {
topCalculatedTariff: (x, y) => topCalculatedTariffService.isTopCalculatedTariff(y) - topCalculatedTariffService.isTopCalculatedTariff(x),
premiumAsc: (x, y) => x.monthlyPremiumGrossInEur - y.monthlyPremiumGrossInEur,
premiumDesc: (x, y) => y.monthlyPremiumGrossInEur - x.monthlyPremiumGrossInEur,
gradeAsc: (x, y) => x.grade - y.grade,
gradeDesc: (x, y) => y.grade - x.grade
};
@dejanr
dejanr / gist:1379a0b992243e4b769c
Created December 6, 2015 14:42
delta calibration
M665 L492.0000 R231.8000 Z832.7500
M666 X-4.100 Y-5.650 Z-4.750
// dump from 503
>>> m503
SENDING:M503
; config override present: /sd/config-override
;Steps per unit:
M92 X100.00000 Y100.00000 Z100.00000
sudo diskutil list
sudo diskutil eraseDisk FAT32 NIXOS_ISO MBRFormat /dev/disk7
sudo diskutil unmountDisk /dev/disk7
sudo dd bs=4m if=~/Downloads/nixos-minimal-16.09pre79453.32b7b00-x86_64-linux.iso of=/dev/rdisk7
λ readelf --all Simplify3D-3.0.2-linux-x64-installer.run
ELF Header:
Magic: 7f 45 4c 46 02 01 01 03 00 00 00 00 00 00 00 00
Class: ELF64
Data: 2's complement, little endian
Version: 1 (current)
OS/ABI: UNIX - GNU
ABI Version: 0
Type: EXEC (Executable file)
Machine: Advanced Micro Devices X86-64
@dejanr
dejanr / README.md
Created July 23, 2016 12:37 — forked from niko/README.md
i3wm & mutt: check mails, blink caps lock led, mark mail workspace as urgent.

This puzzle has 3 parts:

  • A i3wm config that opens mutt in a dedicated workspace. $mod+m will switch to this workspace and will launch mutt, if not already running. Actually it doesn't launch mutt, but…
  • a small wrapper script, which opens a named pipe and then starts mutt.
  • a checkmail script which uses mailcheck(1) to tara check mail. If new mail is available, it blinks the CAPS LOCK led (which I mapped to CTRL anyway) and marks the mutt workspace via a bell.

Additional configuration:

  • set your terminal to mark urgent bells. In Termite the setting is "urgent_on_bell = true".
  • adopt you ~/.mailcheckrc to include paths to your mailboxes. In the simplest case it contains just the line "$(HOME)/Maildir/INBOX"
@dejanr
dejanr / README.md
Created August 30, 2016 21:06 — forked from adewes/README.md
Ebay Ads - Bot. Because who wants to write messages by hand...

To use this bot:

  • Download ads_bot.py and requirements.txt.
  • Type pip install -r requirements.txt to install the requirements.
  • Fill out the required information in the Python file.
  • Ideally, create a (free) Slack account and set up a web hook to receive notifications from the bot.
  • Run the script :)
  • Relax and be ready to answer incoming calls :D
@dejanr
dejanr / css_regression_testing.md
Created February 21, 2017 11:45 — forked from cvrebert/css_regression_testing.md
Survey of screenshot-based CSS testing tools

Currently considering https://github.com/webdriverio/webdrivercss


Core Goals:

  • Can test in up-to-date versions of all major browsers
  • Can test on up-to-date versions of all major OSes
  • Can test in IE9 (because Bootstrap v4 will support IE9+)
  • Don't want to have to setup/maintain our own cluster of VMs running all the necessary OSes (and all the versions of Windows)
  • Workflow for management of reference/baseline/norm screenshots
import db from './connector';
export const schema = [`
type User {
id: Int!
username: String!
role: Int!
display_name: String
title: String
address: String