Skip to content

Instantly share code, notes, and snippets.

const api = require('zotero-api-client'); // >= 0.36.0
const fs = require('fs');
const SparkMD5 = require('spark-md5');
const filedata1 = fs.readFileSync('picture-v1.jpg');
const filedata2 = fs.readFileSync('picture-v2.jpg');
const APIKEY = '';
const USERID = '';
const ITEM_KEY = '';
@tnajdek
tnajdek / .zshrc
Last active September 26, 2020 10:27
.zshrc for OSX
# ZSH history
setopt append_history
setopt hist_expire_dups_first
setopt hist_fcntl_lock
setopt hist_ignore_all_dups
setopt hist_lex_words
setopt hist_reduce_blanks
setopt hist_save_no_dups
setopt share_history
unsetopt menu_complete # do not autoselect the first completion entry
const api = require('./src/api');
const fs = require('fs');
const filedata = fs.readFileSync('picture.jpg');
// live api, vexlign credentials
const APIKEY = '';
const USERID = '';
const ITEM_KEY = '';
(async () => {
@tnajdek
tnajdek / .slate.js
Last active October 18, 2018 12:43
My basic slate file
var moveops = [];
for(let j = 1; j < 5; j++) {
moveops[j] = [];
for(let i = 0; i < j; i++) {
moveops[j][i] = [];
for(let k = 0; k < 5; k++) {
let f = win => {
let op = slate.operation("move", {
x: `screenOriginX + ${i} * (screenSizeX/${j})`,
$breakpoints: (
'minimal': 320,
'small': 480,
'vga': 640,
'tablet': 768,
'medium': 800,
'large': 1000,
'sxga': 1280,
'wsxga': 1680,
'hd': 1920
@minimal: 320px;
@small: 480px;
@medium: 768px;
@large: 1024px;
@hd: 1920px;
@upto-minimal : e(%("screen and (max-width: %d)", @minimal));
@upto-small : e(%("screen and (max-width: %d)", @small));
@upto-medium : e(%("screen and (max-width: %d)", @medium));
@tnajdek
tnajdek / fabfile.py
Created October 6, 2013 19:04
Fabfile for a python backend, js frontend project;
# -*- coding: utf-8 -*-
import logging
import os
from os.path import abspath, dirname, join
from os import environ
from fabric.api import env, task
from fabric.operations import local
from fabric.operations import sudo
from fabric.utils import puts
@tnajdek
tnajdek / lessap.sh
Last active December 15, 2015 19:28
Watch less file/dir for changes and automatically rebuild your css. Works on Linux.
#!/bin/bash
# All the credit goes to Iso
# Original version hosted here: http://code.krml.fr/less.app/src
# Version 2012-02-07
# Compilation stuff
function compile {
# Nice path where the CSS belong
dir=$(readlink -f $(dirname "${cssroot}/${1/#$lessroot}"))
@tnajdek
tnajdek / chrome-dev.sh
Created March 17, 2013 15:06
On Linux runs another clean (without any user-specific data, cookies etc.) instance of the chrome browser alongside existing session. Useful for debugging etc.
#!/bin/bash
/usr/bin/google-chrome --user-data-dir=/tmp --no-default-browser-check -no-first-run $@
// this snippet is valid LESS
// it uses vw units where available (http://caniuse.com/#search=vw)
// and falls back for predefined values for using media queries
// usage .vw(font-size, 5) -> set font-size to at least 5% of the viewport
// .vw(width, 20) -> set width to at least 20% of the viewport
.vw(@prop, @value) {
// this mixin is using a nasty hack due to less' inability
// to define properties as arguments