Skip to content

Instantly share code, notes, and snippets.

View ariunbayar's full-sized avatar
👀
Pothos and FE Type safety

Ariunbayar Baterdene ariunbayar

👀
Pothos and FE Type safety
View GitHub Profile
@ariunbayar
ariunbayar / merge_by_date.sh
Created March 26, 2025 18:49
Joins same day video by date. Original files are archived into a `processed` dir.
#!/bin/bash
# --- Configuration ---
# Video encoding options (same as your example)
VCODEC="libx264"
CRF="23"
PRESET="medium"
ACODEC="aac"
ABITRATE="192k"
OUTPUT_EXT="mp4" # Output container format extension
set nocompatible " be iMproved, required
filetype off " required
let g:airline_powerline_fonts=1
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
@ariunbayar
ariunbayar / aoe voobly profile match list image.js
Last active April 10, 2017 12:22
Shows map image in match list of a users profile
// ==UserScript==
// @name New Userscript
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match http://www.voobly.com/profile/view/*/Matches*
// @grant none
// ==/UserScript==
#!/bin/sh
for f in "$@"; do
mod_date=`stat -c %y "$f" | cut -d ' ' -f1`
file=`basename "$f"`
dir=`dirname "$f"`
mv -- "$f" "$dir/$mod_date $file"
done
@ariunbayar
ariunbayar / log_your_mail.php
Created September 23, 2014 06:39
Logs your sent email for PHP.
#!/usr/bin/php
<?php
/*
* Don't forget to set following in your php.ini:
* sendmail_path = /path/to/mail_log.php
*
* You can test with following php code:
* mail('[email protected]', 'subject', 'body');
*/
$mail = '';
@ariunbayar
ariunbayar / gist:5162c649884e4cecb2d8
Last active August 29, 2015 14:02
spf13 cheatsheet

Python

Shortcut Description
[t Beginning of block
]e End of block
]< Shift block left
]> Shift block right
]# Comment selection
]u Uncomment selection
http://vim.wikia.com/wiki/Mapping_keys_in_Vim_-_Tutorial_(Part_1)
===
In the output of the above commands, the first column indicates the mode in which the map works. You can interpret the first column character using the following table:
n Normal mode map. Defined using ':nmap' or ':nnoremap'.
i Insert mode map. Defined using ':imap' or ':inoremap'.
v Visual and select mode map. Defined using ':vmap' or ':vnoremap'.
x Visual mode map. Defined using ':xmap' or ':xnoremap'.
s Select mode map. Defined using ':smap' or ':snoremap'.
c Command-line mode map. Defined using ':cmap' or ':cnoremap'.
from django.conf import settings
from django.db import connection, transaction
cursor = connection.cursor()
def execute_sql(sql, show_query=False, disable_fk_checks=False):
if disable_fk_checks:
cursor.execute('SET foreign_key_checks = 0;')
cursor.execute(sql)
res = cursor.fetchall()