Skip to content

Instantly share code, notes, and snippets.

@cloudnull
cloudnull / solus-oh-my-zsh-theme.png
Last active September 6, 2023 12:44
Solus zsh theme for oh-my-zsh
solus-oh-my-zsh-theme.png
@subdigital
subdigital / minimal-vim.sh
Last active August 17, 2021 15:44
minimal vim setup for linux servers / vms + swift
#! /bin/bash
set -e
if [[ -f ~/.vimrc ]]
then
echo "You already have a ~/.vimrc. Aborting to avoid losing data..."
exit 1
fi
@pheuberger
pheuberger / NSData-Extension.swift
Last active October 19, 2017 16:58
NSData to hex string conversion in Swift 2
/*
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is furnished
to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
@DTAIEB
DTAIEB / cloudantUpsert.js
Created September 1, 2015 14:27
Upsert a document in a cloudant/couch database
/**
* Update doc if exists, insert a new one if not
* @param: docId
* @param: callback(doc), return updated document by the caller
* @param: done( err, doc ) status callback
*/
this.upsert = function( db, docId, callback, done ){
var insert = function( body ){
//Let caller modify doc if already exists, caller can replace with entirely new doc, however, doc id will be reestablished if doc already exists
var id = body && (body._id || body.id);
@Vestride
Vestride / encoding-video.md
Last active April 24, 2024 09:59
Encoding video for the web

Encoding Video

Installing

Install FFmpeg with homebrew. You'll need to install it with a couple flags for webm and the AAC audio codec.

brew install ffmpeg --with-libvpx --with-libvorbis --with-fdk-aac --with-opus
@tuxfight3r
tuxfight3r / vim-shortcuts.md
Last active May 3, 2024 05:11
VIM SHORTCUTS

VIM KEYBOARD SHORTCUTS

MOVEMENT

h        -   Move left
j        -   Move down
k        -   Move up
l        -   Move right
$        -   Move to end of line
0        -   Move to beginning of line (including whitespace)
@robatron
robatron / javascript-log-wrapping.md
Last active February 6, 2024 06:49
Wrapping `console.log` (et al.) in your own function to modify logging behavior.

JavaScript Log Wrapping

Wrapping console.log (et al.) in your own function to modify logging behavior.

Why?

You may want a simple way to:

@cdown
cdown / gist:1163649
Last active April 9, 2024 01:10
Bash urlencode and urldecode
urlencode() {
# urlencode <string>
old_lc_collate=$LC_COLLATE
LC_COLLATE=C
local length="${#1}"
for (( i = 0; i < length; i++ )); do
local c="${1:$i:1}"
case $c in