Skip to content

Instantly share code, notes, and snippets.

import ui
def closepage(sender):
v.close()
def function_1(sender):
v['label1'].text = 'Oh! You clicked my button.'
#uncomment or comment lines below based on platform
#v = ui.MainView(frame=(0, 0, 600, 450)) # kivy
@galloscript
galloscript / BorderlessWindowMacOSXFile.m
Last active May 17, 2020 04:22
Frameless GLFW/ImGui window in MacOSX
//Get the native window
NSWindow* cocoaWindow = glfwGetCocoaWindow(glfwWindowPtr);
NSUInteger lWindowStyle = NSWindowStyleMaskTitled |
NSWindowStyleMaskClosable |
NSWindowStyleMaskMiniaturizable |
NSWindowStyleMaskResizable |
NSWindowStyleMaskUnifiedTitleAndToolbar |
NSWindowStyleMaskFullSizeContentView;
//Set the style mask
@darencard
darencard / auto_git_file.md
Last active February 9, 2025 12:05
Automatic file git commit/push upon change

Please see the most up-to-date version of this protocol on my blog at https://darencard.net/blog/.

Automatically push an updated file whenever it is changed

Linux

  1. Make sure inotify-tools is installed (https://github.com/rvoicilas/inotify-tools)
  2. Configure git as usual
  3. Clone the git repository of interest from github and, if necessary, add file you want to monitor
  4. Allow username/password to be cached so you aren't asked everytime
@cbeck88
cbeck88 / ffh2.sh
Created July 30, 2017 05:29
play on linux install script for Civilization IV: Beyond the Sword, and the Fall from Heaven 2 mod
#!/bin/bash
# Date : (2013-06-26)
# Last revision : (2017-07-29)
# Wine version used : 2.13-staging
# Distribution used to test : xUbuntu 16.04
# Author : Jimmy Ramsmark, Chris Beck
# Licence : GPLv3
# Depend : msxml3, d3dx9
# This script was tested using the DVD version of `Civilization IV: Complete'
@windyinsc
windyinsc / ffmpeg-cheatsheet.md
Last active January 30, 2025 08:40 — forked from larvata/ffmpeg-cheatsheet.md
ffmpeg notes

ffmpeg Cheatsheet

  • Join TS Files
  • Convert TS to MP4
  • Download Online AES-128 Encrypted HLS video
  • Convert Video to GIF
  • Extract Audio and Convert it to MP3
  • Burn Subtitles into Video

Join TS Files

@posener
posener / go-shebang-story.md
Last active June 6, 2025 17:44
Story: Writing Scripts with Go

Story: Writing Scripts with Go

This is a story about how I tried to use Go for scripting. In this story, I’ll discuss the need for a Go script, how we would expect it to behave and the possible implementations; During the discussion I’ll deep dive to scripts, shells, and shebangs. Finally, we’ll discuss solutions that will make Go scripts work.

Why Go is good for scripting?

While python and bash are popular scripting languages, C, C++ and Java are not used for scripts at all, and some languages are somewhere in between.

@ajbouh
ajbouh / create-registry.sh
Created October 11, 2017 16:46
Create a private Docker registry on a fresh Kubernetes Cluster
set -ex
REGISTRY_INGRESS_IP=10.73.177.23
REGISTRY_INGRESS_REGISTRY_INGRESS_HOSTNAME=registry.$REGISTRY_INGRESS_IP.xip.io
# if [ ! -e $REGISTRY_INGRESS_HOSTNAME.key ]; then
# echo '{"CN":"'$REGISTRY_INGRESS_HOSTNAME'","hosts":[""],"key":{"algo":"rsa","size":2048}}' | cfssl gencert -config=ca-config.json -ca=ca.pem -ca-key=ca-key.pem -hostname="$REGISTRY_INGRESS_HOSTNAME" - | cfssljson -bare $REGISTRY_INGRESS_HOSTNAME
# fi
# juju ssh easyrsa/0
@heroheman
heroheman / ranger-cheatsheet.md
Last active June 30, 2025 11:47
Ranger Cheatsheet

Ranger Cheatsheet

General

Shortcut Description
ranger Start Ranger
Q Quit Ranger
R Reload current directory
? Ranger Manpages / Shortcuts
@CharlesHolbrow
CharlesHolbrow / bump.sh
Created March 2, 2018 22:10
minimal build version tracking
#!/bin/bash
# This is a simple script that increments the integer in a the 'build-version'
# file, and makes a new commit. The new commit will be tagged with the branch
# and version
#
# You may specify a path. If no path is specified, the working directory will be
# used.
#
# Eventually we might want to replace this with a proper CI pipline, but this
@uraimo
uraimo / dnsovertls.md
Last active June 2, 2025 03:20
Configure your Mac to use DNS over TLS