Skip to content

Instantly share code, notes, and snippets.

#!/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
#!/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/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/
# get yourt as root. Even after fucked up change in arch where makepkg just won't fucking work as root
cd /tmp
pacman -S --noconfirm base-devel
curl -O https://aur.archlinux.org/packages/pa/package-query/package-query.tar.gz
tar zxvf package-query.tar.gz
chmod -R 777 package-query
cd package-query
sudo -u nobody makepkg -s --noconfirm
pacman -U --noconfirm *.tar.xz
cd ..
@tnajdek
tnajdek / .gitignore
Created August 2, 2014 10:46
Unity .gitignore
# Unity generated #
# =============== #
Temp/
Obj/
UnityGenerated/
Library/
# ===================================== #
# Visual Studio / MonoDevelop generated #
# ===================================== #
@tnajdek
tnajdek / anchors.js
Created March 31, 2015 18:36
Assemble plugin to automatically generate and attach ids and anchor links to headers
/*eslint-env node */
var cheerio = require('cheerio'),
htmlStrip = require('htmlstrip-native');
var options = {
stage: 'render:post:page'
};
@tnajdek
tnajdek / charts.js
Created March 31, 2015 19:09
Handlebar helper I use with grunt-assemble to generate charts as images for a static blog
Handlebars.registerHelper('chart', function(width, height, type, title, options) {
var config = JSON.parse(options.fn(this)),
canvas = new Canvas(width, height),
ctx = canvas.getContext('2d'),
method = type[0].toUpperCase() + type.slice(1),
uniqueName = crypto.createHash('md5').update(width + height + type + title + options.fn(this)).digest('hex'),
chartFileName = uniqueName + '.png';
new Chart(ctx)[method](config);
@tnajdek
tnajdek / guessmovies.py
Created April 3, 2015 19:47
This simple script will guess movie titles based on the file names and move them to collection dir
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# This simple script will guess movie titles based on the file names and move them to collection dir
# Useful when you have movies with names like Star.Wars.Phantom.Menace.mkv and you want them
# in your collection in folders like Star Wars: Episode VI - Return of the Jedi (1983)
# To get dependencies run `pip install IMDbPY==5.0 guessit==0.10.2`
from __future__ import print_function
import os
import argparse
import imdb
@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) {
@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)"