Skip to content

Instantly share code, notes, and snippets.

@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active November 17, 2024 01:28
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@thomasfr
thomasfr / Git push deployment in 7 easy steps.md
Last active July 3, 2024 02:22
7 easy steps to automated git push deployments. With small and configurable bash only post-receive hook
@CrocoDillon
CrocoDillon / cookies.js
Last active February 11, 2024 22:42
Export your awesome module using AMD, CommonJS, Node.js or just as global.
/*
* Inspiration (well… copy pasting more or less) from:
* https://github.com/ScottHamper/Cookies/blob/0.3.1/src/cookies.js#L127-L140
*
* Thanks Scott!
*/
(function (global) {
'use strict';
var MyModule = function () {
@gerbsen
gerbsen / ssh_agent_start.fish
Last active July 16, 2024 16:52 — forked from schaary/ssh_agent_start.fish
Auto-launching ssh-agent in fish shell
# content has to be in .config/fish/config.fish
# if it does not exist, create the file
setenv SSH_ENV $HOME/.ssh/environment
function start_agent
echo "Initializing new SSH agent ..."
ssh-agent -c | sed 's/^echo/#echo/' > $SSH_ENV
echo "succeeded"
chmod 600 $SSH_ENV
. $SSH_ENV > /dev/null
@windsting
windsting / starting-postgresql-in-windows-without-install.md
Created September 20, 2018 10:50
Starting Postgresql in Windows without Install

Starting Postgresql in Windows without Install

Problem

This is a question that comes up quite often by windows users, so thought we would share how we normally do it. The question is

Can you run a PostgreSQL server on your windows desktop/server box without having to install anything?

The answer is

// WARNING: There's much more to know/do around hooks, and
// this is just a simplification of how these work.
// shared references, updated
// per each hook invoke
let execution = null;
let current = null;
let context = null;
let args = null;
@davidfowl
davidfowl / ModuleLoader.cs
Last active March 5, 2023 19:21
ModuleLoader: This handles concurrent requests adding modules and duplicates
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.IO;
using System.Reflection;
using System.Runtime.Loader;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc.ApplicationParts;
using Microsoft.AspNetCore.Mvc.Infrastructure;
@fernandoherreradelasheras
fernandoherreradelasheras / smart-video-cutter.sh
Created February 26, 2022 17:01
Smart video cutter with minimal transcoding using ffmpg
#!/usr/bin/bash
#
# Cut a fragment of a video with the minimal possible re-encoding.
# If the new start point is not a key frame it reencodes the video
# from that point until the frame before a new keyframe. The remaining
# part is copied as passthrough and both fragments are concatenated
#
# In order to make the video streams compatible we use the same codec
# and bitrate. This works fine with h264. No idea about other codecs