Skip to content

Instantly share code, notes, and snippets.

View catb0t's full-sized avatar
💭
hmm

Cat Stevens catb0t

💭
hmm
View GitHub Profile
@jed
jed / LICENSE.txt
Created May 20, 2011 13:27 — forked from 140bytes/LICENSE.txt
generate random UUIDs
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Jed Schmidt <http://jed.is>
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
@sergiobuj
sergiobuj / mask.c
Created February 7, 2012 04:28
CGEventFlag bit mask and hotkey detection
if( ((flags & kCGEventFlagMaskAlphaShift) == 0 &&
(flags & kCGEventFlagMaskShift) == 0 &&
(flags & kCGEventFlagMaskControl) == 0 &&
(flags & kCGEventFlagMaskAlternate) == 0 &&
(flags & kCGEventFlagMaskCommand) == kCGEventFlagMaskCommand &&
(flags & kCGEventFlagMaskHelp) == 0 &&
(flags & kCGEventFlagMaskSecondaryFn) == kCGEventFlagMaskSecondaryFn &&
(flags & kCGEventFlagMaskNumericPad) == kCGEventFlagMaskNumericPad &&
(flags & kCGEventFlagMaskNonCoalesced) == kCGEventFlagMaskNonCoalesced) &&
@masak
masak / explanation.md
Last active May 21, 2024 20:05
How is git commit sha1 formed

Ok, I geeked out, and this is probably more information than you need. But it completely answers the question. Sorry. ☺

Locally, I'm at this commit:

$ git show
commit d6cd1e2bd19e03a81132a23b2025920577f84e37
Author: jnthn <jnthn@jnthn.net>
Date:   Sun Apr 15 16:35:03 2012 +0200

When I added FIRST/NEXT/LAST, it was idiomatic but not quite so fast. This makes it faster. Another little bit of masak++'s program.

@aspyct
aspyct / signal.c
Last active February 19, 2024 11:24
Unix signal handling example in C, SIGINT, SIGALRM, SIGHUP...
/**
* More info?
* a.dotreppe@aspyct.org
* http://aspyct.org
*
* Hope it helps :)
*/
#include <stdio.h>
#include <stdlib.h>
@hi2p-perim
hi2p-perim / ssecheck.cpp
Last active March 17, 2024 14:50
Check SSE/AVX instruction support.
/*
Check SSE/AVX support.
This application can detect the instruction support of
SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, SSE4a, SSE5, and AVX.
*/
#include <iostream>
#ifdef _MSC_VER
#include <intrin.h>
#endif
@nitaku
nitaku / README.md
Last active May 12, 2024 22:24
Minimal JSON HTTP server in python

A minimal HTTP server in python. It sends a JSON Hello World for GET requests, and echoes back JSON for POST requests.

python server.py 8009
Starting httpd on port 8009...
curl http://localhost:8009
{"received": "ok", "hello": "world"}
@sam159
sam159 / minunit.h
Last active March 6, 2024 12:26
minunit header for unit testing c code
/*
* File: minunit.h
* Author: Zed. A. Shaw, Sam
*
* @see http://c.learncodethehardway.org/book/ex30.html
*
* Created on 27 August 2014, 22:14
*/
#ifndef MINUNIT_H
@protrolium
protrolium / ffmpeg.md
Last active May 15, 2024 18:27
ffmpeg guide

ffmpeg

Converting Audio into Different Formats / Sample Rates

Minimal example: transcode from MP3 to WMA:
ffmpeg -i input.mp3 output.wma

You can get the list of supported formats with:
ffmpeg -formats

You can get the list of installed codecs with:

@alirobe
alirobe / reclaimWindows10.ps1
Last active May 22, 2024 20:58
This Windows 10 Setup Script turns off a bunch of unnecessary Windows 10 telemetery, bloatware, & privacy things. Not guaranteed to catch everything. Review and tweak before running. Reboot after running. Scripts for reversing are included and commented. Fork of https://github.com/Disassembler0/Win10-Initial-Setup-Script (different defaults). N.…
###
###
### UPDATE: For Win 11, I recommend using this tool in place of this script:
### https://christitus.com/windows-tool/
### https://github.com/ChrisTitusTech/winutil
### https://www.youtube.com/watch?v=6UQZ5oQg8XA
### iwr -useb https://christitus.com/win | iex
###
###
@bmaupin
bmaupin / install-openjdk-6-ubuntu-16.sh
Last active December 22, 2023 12:11
Install openjdk-6-jdk on Ubuntu/Xubuntu 16.04
# NOTE: This is a hack and will downgrade the tzdata package.
# Better alternatives:
# - Use Azul Zulu build of OpenJDK 6 (https://www.azul.com/downloads/zulu/zulu-linux/ - make sure you enable the box labeled Older Zulu versions)
# - Install Java 6 directly from Oracle and install it manually (https://gist.github.com/bmaupin/16855ce1b2484c459f41ad836a7d3f2f)
wget http://launchpadlibrarian.net/235298493/openjdk-6-jdk_6b38-1.13.10-1_amd64.deb
wget http://launchpadlibrarian.net/235298496/openjdk-6-jre_6b38-1.13.10-1_amd64.deb
wget http://launchpadlibrarian.net/235298494/openjdk-6-jre-headless_6b38-1.13.10-1_amd64.deb
wget http://launchpadlibrarian.net/235298487/openjdk-6-jre-lib_6b38-1.13.10-1_all.deb
wget http://launchpadlibrarian.net/250277191/tzdata_2016c-0ubuntu1_all.deb