Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
#rsync just new/changed files ignoring all meta/permissions/time/ownership/shitnot changes
rsync -aviz --no-p --no-t --no-o --no-g --ignore-times --size-only root@host:/some/remote/dir/ localdir/
#!/bin/bash
URL="http://google.com/"
resolutions=( 1366x768 320x480 480x800 1024x768 320x568 1280x800 1920x1080 360x640 768x1024 720x1280 1440x900 1600x900 1280x1024 320x534 320x401 1680x1050 540x960 360x592 480x854 1024x600 )
killall firefox
for i in "${resolutions[@]}"
do
echo $i
pair=`echo $i | tr "x" " "`
firefox &
#!/bin/sh
#thank you http://superuser.com/questions/226192/openssl-without-prompt
openssl req -new -newkey rsa:4096 -days 365 -nodes -x509 -subj "/C=US/ST=Denial/L=Springfield/O=Dis/CN=www.example.com" -keyout www.example.com.key -out www.example.com.crt
@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
@tnajdek
tnajdek / .zshrc
Last active December 11, 2015 12:18
ZSH=/usr/share/oh-my-zsh/
ZSH_CUSTOM=~/.oh-my-zsh/custom/
ZSH_THEME="robbyrussell"
DISABLE_AUTO_UPDATE="true"
plugins=(git archlinux django sublime themes python pip node npm history-substring-search zsh-syntax-highlighting)
source $ZSH/oh-my-zsh.sh
eval "$(fasd --init auto)"
@tnajdek
tnajdek / transitionend.js
Last active December 10, 2015 12:59
Simple jQuery plugin to handle transitionend events in a nice, unified, cross-browser-compatible way
// $().addClass('hasTransition').transitionend(function() { console.log('this will happen once css transition ends'); }
define(['jquery'], function ($) {
"use strict";
$.fn.transitionend = function(callback) {
this.each(function() {
var transitionend = false,
$this = $(this),
cleanup = function() {
if(!transitionend) {