Skip to content

Instantly share code, notes, and snippets.

@nishanths
nishanths / main.js
Last active August 7, 2019 23:46
Electron tray: Drag and Drop events demo
var app = require('app');
var Menu = require('menu');
var Tray = require('tray');
var appIcon = null;
app.on('ready', function(){
// image is null, so image will not be shown in menu bar
// so click around on the system menu bar to locate the space where the tray icon is
appIcon = new Tray(null);
@XueshiQiao
XueshiQiao / gource.sh
Last active November 10, 2019 15:56 — forked from cgoldberg/gource.sh
Generate a MP4 Video for your Git project commits using Gource!
# 1.install gource using HomeBrew
$ brew install gource
# 2.install avconv
git clone git://git.libav.org/libav.git
cd libav
# it will take 3-5 minutes to complie, be patient.
./configure --disable-yasm
make && make install
@twolfson
twolfson / .gitignore
Last active March 27, 2020 20:29
Proof of concept to explore media keys for https://github.com/twolfson/google-music-electron/issues/31
node_modules/
@KonradIT
KonradIT / autoexec.ash
Created January 26, 2014 09:41
Set custom exp, replace iris, gain, and shutter by your custom settings
sleep 2
t ia2 -exp set 1 iris gain shutter
@KonradIT
KonradIT / timelapse-assembler.sh
Created May 11, 2014 07:44
Timelapse assembler
mkdir temp
cp *.JPG temp/.
mogrify -resize 200x200 temp/*.JPG
convert temp/*.JPG -delay 10 -morph 5 temp/%05d.jpg
ffmpeg -r 50 -qscale 2 -i temp/%05d.jpg output.mp4
@phpdude
phpdude / nginx.conf
Last active February 28, 2024 04:36
Nginx image filter + caching of results.
location /resize {
alias /tmp/nginx/resize;
set $width 150;
set $height 100;
set $dimens "";
if ($uri ~* "^/resize_(\d+)x(\d+)/(.*)" ) {
set $width $1;
set $height $2;
set $image_path $3;
@ZwodahS
ZwodahS / copy_redis_key.sh
Created March 1, 2016 06:07
copy a redis db key to another place (use MIGRATE COPY for v3.0<= redis)
#!/bin/bash
# source http://stackoverflow.com/questions/23222616/copy-all-keys-from-one-db-to-another-in-redis
#set connection data accordingly
source_host=localhost
source_port=6379
source_db=1
target_host=localhost
target_port=6379
target_db=2
@spalladino
spalladino / mysql-docker.sh
Created December 22, 2015 13:47
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
@myusuf3
myusuf3 / delete_git_submodule.md
Created November 3, 2014 17:36
How effectively delete a git submodule.

To remove a submodule you need to:

  • Delete the relevant section from the .gitmodules file.
  • Stage the .gitmodules changes git add .gitmodules
  • Delete the relevant section from .git/config.
  • Run git rm --cached path_to_submodule (no trailing slash).
  • Run rm -rf .git/modules/path_to_submodule (no trailing slash).
  • Commit git commit -m "Removed submodule "
  • Delete the now untracked submodule files rm -rf path_to_submodule
@drmalex07
drmalex07 / README-setup-tunnel-as-systemd-service.md
Last active May 4, 2024 15:04
Setup a secure (SSH) tunnel as a systemd service. #systemd #ssh #ssh-tunnel #ssh-forward

README

Create a template service file at /etc/systemd/system/secure-tunnel@.service. The template parameter will correspond to the name of target host:

[Unit]
Description=Setup a secure tunnel to %I
After=network.target