Skip to content

Instantly share code, notes, and snippets.

@hasenj
hasenj / app_metal.c
Created December 30, 2019 12:46
Pure C Cocoa Application with Window and Metal
// How to build:
// # compile the metal shaders
// xcrun -sdk macosx metal -c shaders.metal -o shaders.air
// xcrun -sdk macosx metallib shaders.air -o shaders.metallib
// # compile the c file
// clang app_metal.c -framework Cocoa -framework Metal -o metal_c.app
//
//
// Draw a triangle using metal
// Metal tutorial followed here: https://www.raywenderlich.com/7475-metal-tutorial-getting-started
@soywiz
soywiz / gradle_to_m2.kts
Created December 6, 2016 17:27
Copy gradle cache structure into local m2 folder structure
import java.io.File
import java.security.MessageDigest
val gradleBase = System.getenv("HOME") + "/.gradle/caches/modules-2/files-2.1"
val m2Base = System.getenv("HOME") + "/.m2/repository"
fun ByteArray.toHex() = this.map { "%02x".format(it) }.joinToString("")
operator fun File.get(name: String) = File(this, name)
for (groupFolder in File(gradleBase).listFiles().filter { it.isDirectory }) {
val group = groupFolder.name
@lukewpatterson
lukewpatterson / gist:4242707
Created December 9, 2012 00:24
squeezing private SSH key into .travis.yml file
Tricks to add encrypted private SSH key to .travis.yml file
To encrypt the private SSH key into the "-secure: xxxxx....." lines to place in the .travis.yml file, generate a deploy key then run: (to see what the encrypted data looks like, see an example here: https://github.com/veewee-community/veewee-push/blob/486102e6f508214b04414074c921475e5943f682/.travis.yml#L21
base64 --wrap=0 ~/.ssh/id_rsa > ~/.ssh/id_rsa_base64
ENCRYPTION_FILTER="echo \$(echo \"-\")\$(travis encrypt veewee-community/veewee-push \"\$FILE='\`cat $FILE\`'\" | grep secure:)"
split --bytes=100 --numeric-suffixes --suffix-length=2 --filter="$ENCRYPTION_FILTER" ~/.ssh/id_rsa_base64 id_rsa_
@p01
p01 / LICENSE.txt
Created October 13, 2011 19:29 — forked from 140bytes/LICENSE.txt
Music SoftSynth
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Mathieu 'p01' Henri http://www.p01.org/releases/
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@p01
p01 / LICENSE.txt
Last active May 23, 2024 13:46 — forked from 140bytes/LICENSE.txt
Sudoku Solver in 140bytes
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Mathieu 'p01' Henri - http://www.p01.org/releases/
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE