Skip to content

Instantly share code, notes, and snippets.

jnx / Exiftool Canonize
Created Feb 23, 2021 — forked from jmuspratt/Exiftool Canonize
exiftool : rename files in current dir to YYYY-MM-DD-HH-MM-SS-1.ext
View Exiftool Canonize
# Rename image and MOV files according to EXIF capture date, using YYYY-MM-DD-HH-MM-SS.ext
# Files shot within the same second get copy number added (-1,-2, etc.).
# Video files require a different, so we run exiftool 3 times:
# 1. Exclude MOV files and rename the image files with <CreateDate>.
# 2. Target MOV files and rename them with MediaCreateDate (for iPhone videos).
# 3. Target MOV files and rename them with DateTimeOriginal (for Fuji camera videos).
# Requirements: install the package manager Homebrew (, then install exiftool (type brew install exiftool in
# Now open, cd to the relevant directory, and run the command.
jnx /
Created Oct 15, 2018 — forked from maximilian-lindsey/
How to run Express inside an Electron app

How to run Express inside an Electron app

You can run your Express app very easily inside your Electron app.

All you need to do is to:

  • place all the files of your Express app inside a new app folder in your_electron_app\resources\app
  • reconfigure the app.js file
  • refactor some relative pathes in your Express app
jnx / nginx-config.conf
Created Jan 3, 2018 — forked from konovalov-nk/nginx-config.conf
Useful nginx SSL hardened (letsencrypt) config for setting up Rails application with Puma webserver
View nginx-config.conf
upstream myappdev {
server unix:///home/your_user/git/;
# don't forget to add this to server {..} block
# add_header X-Xss-Protection "1; mode=block";
server {
listen 80;
listen 443 ssl http2;
jnx / recursive-division.rb
Created Nov 9, 2017 — forked from jamis/recursive-division.rb
An implementation of the "Recursive Division" algorithm for maze generation.
View recursive-division.rb
# --------------------------------------------------------------------
# An implementation of the "Recursive Division" algorithm. This is a
# kind of fractal maze algorithm, recursively dividing the maze into
# smaller and smaller cells. This algorithm stops at the integer
# boundary, but theoretically the algorithm could continue infinitely
# to smaller and smaller scales.
# Note that this algorithm is implemented as a "wall adder", rather
# than a "passage carver", so the meaning of the bits in each cell
# is reversed: instead of the S bit (for instance) meaning "a passage
jnx / Getting some equivalent of using nginx and dnsmasq on non-Apple *NIX

Install nginx and dnsmasq

Using apt-get/dnf/pkg_add/ports/rpm/pacman/whatever...

Add necessary config files


# /etc/dnsmasq.d/dev
jnx / git_aliases.zsh
Created Sep 13, 2016
git and git-flow aliases
View git_aliases.zsh
alias gft="git fetch --tags"
alias gpt="git push --tags"
alias gcm="git checkout master"
alias gmm="git merge master"
alias gcd="git checkout develop"
alias gmd="git merge develop"
gcf() { git checkout feature/$1; }
View new_invitation.html.erb
<!-- /app/views/admin/users/new_invitiations.html.erb -->
<h2>Send invitation</h2>
<%= form_for @user, :url => send_invitation_admin_users_path do |f| %>
<table style='width: 50%'>
<td><%= f.label :first_name %></td>
<td><%= f.text_field :first_name %></td>
View add.js.erb
<td><%=@key.split(".").drop(1) %></td>
<td><%= @value%></td>
View spec_helper.rb
ENV["RAILS_ENV"] = "test"
require File.expand_path('../../config/environment', __FILE__)
require 'rubygems'
gem 'minitest'
require 'minitest/autorun'
require 'action_controller/test_case'
require 'miniskirt'
require 'capybara/rails'
View gist:6409792
function precmd() {
if command git rev-parse --git-dir > /dev/null 2>&1; then
window_label=$(git rev-parse --show-toplevel)
tab_label=$(echo $window_label | awk -F\/ '{print "[git] " $NF}')
echo -ne "\e]2;${window_label}\a"
echo -ne "\e]1;${tab_label: -24}\a"