Skip to content

Instantly share code, notes, and snippets.

# Luke's config for the Zoomer Shell
# Enable colors and change prompt:
autoload -U colors && colors
PS1="%B%{$fg[red]%}[%{$fg[yellow]%}%n%{$fg[green]%}@%{$fg[blue]%}%M %{$fg[magenta]%}%~%{$fg[red]%}]%{$reset_color%}$%b "
# History in cache directory:
HISTSIZE=10000
SAVEHIST=10000
HISTFILE=~/.cache/zsh/history
@ganapativs
ganapativs / iTerm2 + oh-my-zsh + Pure theme + zsh plugins setup.md
Last active April 26, 2024 02:55
iTerm2 + oh-my-zsh + Pure theme + zsh plugins setup
@akehrer
akehrer / sqlite_to_json.sql
Created January 9, 2018 19:58
SQLite Results as JSON using the SQLite JSON1 extension
-- When SQLite is compiled with the JSON1 extensions it provides builtin tools
-- for manipulating JSON data stored in the database.
-- This is a gist showing SQLite return query data as a JSON object.
-- https://www.sqlite.org/json1.html
-- An example table with some data
CREATE TABLE users (
id INTEGER PRIMARY KEY NOT NULL,
full_name TEXT NOT NULL,
email TEXT NOT NULL,
@primaryobjects
primaryobjects / m3u8.md
Last active May 1, 2024 06:24
How to download m3u8 and ts video movie streams.

m3u8 Downloading

  1. Open Chrome Developer tools and click the Network tab.
  2. Navigate to the page with the video and get it to start playing.
  3. Filter the list of files to "m3u8".
  4. Find master.m3u8 or index.m3u8 and click on it.
  5. Save the file to disk and look inside it.
  6. If the file contains a single m3u8 master url, copy that one instead.
  7. Run the program m3u8x.
  8. Paste the same m3u8 url in both textboxes (URL and Quality URL) and click "Headers" and set the referral url and user-agent from the request as found in Chrome.
@tomsing1
tomsing1 / luigi_first_steps.md
Last active October 7, 2023 13:23
First steps with the Luigi workflow manager

First steps with the Luigi workflow manager

As an introduction into Luigi, I am following this tutorial with some modifications, e.g. installation using conda.

The problems and solutions described in the examples below have led to the development of sciluigi,

@sketchytech
sketchytech / TimeDate.swift
Created November 14, 2016 10:11
Swift 3: Time and Date
import UIKit
// see here for details about date formatter https://developer.apple.com/library/ios/documentation/Cocoa/Conceptual/DataFormatting/Articles/dfDateFormatting10_4.html#//apple_ref/doc/uid/TP40002369
func time()->(h:Int,m:Int,s:Int) {
let formatStrings = ["hh","mm","ss"]
var hms = [Int]()
let dateFormatter = DateFormatter()
let date = Date()
@ttscoff
ttscoff / dontforget.bash
Last active November 8, 2023 06:42
Quick reminders from Terminal (bash)
#!/bin/bash
# dontforget
#
# A stupid script for short term reminders in bash
#
# Arguments just need to contain a number and a bunch of words.
#
# The number can be anywhere in the arguments, but there shouldn't
# be any other numeric digits.
#
@tsl0922
tsl0922 / .tmux.conf
Last active April 30, 2024 10:29
vim style tmux config
# vim style tmux config
# use C-a, since it's on the home row and easier to hit than C-b
set-option -g prefix C-a
unbind-key C-a
bind-key C-a send-prefix
set -g base-index 1
# Easy config reload
bind-key R source-file ~/.tmux.conf \; display-message "tmux.conf reloaded."
@natelandau
natelandau / .bash_profile
Last active April 30, 2024 18:07
Mac OSX Bash Profile
# ---------------------------------------------------------------------------
#
# Description: This file holds all my BASH configurations and aliases
#
# Sections:
# 1. Environment Configuration
# 2. Make Terminal Better (remapping defaults and adding functionality)
# 3. File and Folder Management
# 4. Searching
# 5. Process Management
@pkuczynski
pkuczynski / parse_yaml.sh
Last active April 9, 2024 18:36
Read YAML file from Bash script
#!/bin/sh
parse_yaml() {
local prefix=$2
local s='[[:space:]]*' w='[a-zA-Z0-9_]*' fs=$(echo @|tr @ '\034')
sed -ne "s|^\($s\)\($w\)$s:$s\"\(.*\)\"$s\$|\1$fs\2$fs\3|p" \
-e "s|^\($s\)\($w\)$s:$s\(.*\)$s\$|\1$fs\2$fs\3|p" $1 |
awk -F$fs '{
indent = length($1)/2;
vname[indent] = $2;
for (i in vname) {if (i > indent) {delete vname[i]}}