Skip to content

Instantly share code, notes, and snippets.

View uldza's full-sized avatar
🎯
Focusing

Uldis M uldza

🎯
Focusing
View GitHub Profile
@uldza
uldza / file.md
Created April 3, 2018 06:18 — forked from stvnwlsn/file.md
transmission-daemon FreeBSD

Install and setup transmission daemon

$ cd /usr/ports/net-p2p/transmission-daemon
$ sudo make install
$ sudo mkdir /srv/torrents/{autoload,data}
$ sudo chown -R transmission:transmission /srv/torrents/
$ sudo chmod -R go+w /srv/torrents/
$ sudo vim /etc/rc.conf
@uldza
uldza / print.hrl
Created January 18, 2018 12:53
Erlang pretty printing with ANSI console colors
%%%-------------------------------------------------------------------
%%% @author Ahmad Baitalmal
%%% @copyright (C) 2017, Ahmad Baitalmal
%%% Permission is hereby granted, free of charge, to any person obtaining
%%% a copy of this software and associated documentation files
%%% (the “Software”), to deal in the Software without restriction,
%%% including without limitation the rights to use, copy, modify, merge,
%%% publish, distribute, sublicense, and/or sell copies of the Software,
%%% and to permit persons to whom the Software is furnished to do so,
%%% subject to the following conditions:

Vim Cheatsheet

Generally helpful stuff

Open a file for editing             :e path/to/file.txt
Return to Normal mode               ESC   or <CTRL>+C

Navigating around text

@uldza
uldza / tmux-cheatsheet.markdown
Created September 21, 2016 11:01 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@uldza
uldza / .tmux.conf
Last active September 11, 2015 12:18 — forked from snuggs/.tmux.conf
TMUX configuration file
##############################
# _
# | |_ _ __ ___ _ ___ __
# | __| '_ ` _ \| | | \ \/ /
# | |_| | | | | | |_| |> <
# \__|_| |_| |_|\__,_/_/\_\
#
#############################
#
# COPY AND PASTE
# Add sinon.js gem to your `group :development, :test`
gem 'sinon-rails'
# Add code to stub javascript time in your application.haml (.erb) layout file, at the same time you are using Timecop.travel
- if defined?(Timecop) && Timecop.top_stack_item
= javascript_include_tag "sinon"
- unix_millis = (Time.now.to_f * 1000.0).to_i
:javascript
sinon.useFakeTimers(#{unix_millis});
@uldza
uldza / gist:6711bc47c823656f97cd
Last active June 18, 2018 20:36
Image optim and dragonfly
# Add gem
https://github.com/toy/image_optim
# For production/demo install instructions look in gem readme
### UBUNTU 12.04 image_optim requirments:
> sudo add-apt-repository ppa:danmbox/ppa
> sudo apt-get update
> sudo apt-get install -y advancecomp gifsicle jhead jpegoptim libjpeg-progs optipng pngcrush pngquant
# download pngout from http://www.jonof.id.au/kenutils
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')