Skip to content

Instantly share code, notes, and snippets.

@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active April 18, 2024 10:01
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@borismus
borismus / gist:1032746
Created June 18, 2011 02:46
Convert a base64 string into a binary Uint8 Array
var BASE64_MARKER = ';base64,';
function convertDataURIToBinary(dataURI) {
var base64Index = dataURI.indexOf(BASE64_MARKER) + BASE64_MARKER.length;
var base64 = dataURI.substring(base64Index);
var raw = window.atob(base64);
var rawLength = raw.length;
var array = new Uint8Array(new ArrayBuffer(rawLength));
for(i = 0; i < rawLength; i++) {
@tilkinsc
tilkinsc / load_dds.c
Last active March 23, 2024 17:20
C OpenGL DDS Loading Tutorial
/*
Can load easier and more indepth with https://github.com/Hydroque/DDSLoader
Because a lot of crappy, weird DDS file loader files were found online. The resources are actually VERY VERY limited.
Written in C, can very easily port to C++ through casting mallocs (ensure your imports are correct), goto can be replaced.
https://www.gamedev.net/forums/topic/637377-loading-dds-textures-in-opengl-black-texture-showing/
http://www.opengl-tutorial.org/beginners-tutorials/tutorial-5-a-textured-cube/
^ Two examples of terrible code
@reborg
reborg / rich-already-answered-that.md
Last active February 23, 2024 13:09
A curated collection of answers that Rich gave throughout the history of Clojure

Rich Already Answered That!

A list of commonly asked questions, design decisions, reasons why Clojure is the way it is as they were answered directly by Rich (even when from many years ago, those answers are pretty much valid today!). Feel free to point friends and colleagues here next time they ask (again). Answers are pasted verbatim (I've made small adjustments for readibility, but never changed a sentence) from mailing lists, articles, chats.

How to use:

  • The link in the table of content jumps at the copy of the answer on this page.
  • The link on the answer itself points back at the original post.

Table of Content

@charles-rumley
charles-rumley / 1password-vpn-login.sh
Created May 28, 2019 21:58
Use stored 1Password credentials to authenticate a Cisco AnyConnect VPN client
#!/usr/bin/env bash
# Prerequisites
#
# Download the 1Password CLI tool
#
# brew cask install 1password-cli
#
# Before using this script, you'll need to authenticate the 1Password
# CLI for the first time. Use the following command, replacing
#!/bin/bash
###
### my-script — does one thing well
###
### Usage:
### my-script <input> <output>
###
### Options:
### <input> Input file to read.
### <output> Output file to write. Use '-' for stdout.

Uninstall brew package and dependencies

Remove package's dependencies (does not remove package):

brew deps [FORMULA] | xargs brew remove --ignore-dependencies

Remove package:

@WebReflection
WebReflection / Object.extra.js
Created August 16, 2012 20:42
Object.getPropertyDescriptor and Object.getPropertyNames
!function(Object, getPropertyDescriptor, getPropertyNames){
// (C) WebReflection - Mit Style License
if (!(getPropertyDescriptor in Object)) {
var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
Object[getPropertyDescriptor] = function getPropertyDescriptor(o, name) {
var proto = o, descriptor;
while (proto && !(
descriptor = getOwnPropertyDescriptor(proto, name))
) proto = proto.__proto__;
return descriptor;
#include <eternity.hpp>
ScriptSystem::ScriptSystem() {
m_platform = 0;
m_isolate = 0;
m_scriptableCount = 0;
m_scriptablePoolSize = 0;
m_scriptables = 0;
}
anonymous
anonymous / O2minipop.ino
Created March 17, 2016 21:24
// O2 Minipops rhythm box (c) DSP Synthesizers 2016
// Free for non commercial use
// http://janostman.wordpress.com
#include <avr/interrupt.h>
#include <avr/io.h>
#include <avr/pgmspace.h>