Skip to content

Instantly share code, notes, and snippets.

View template.h
/* Lightweight module based templates in standard C
===================================================
This is a proof of concept example of lightweight module based templates in C and
is loosely based on https://gist.github.com/pervognsen/c56d4ddce94fbef3c80e228b39efc028 from Per Vognsen.
While his approach (at least as far as I understood) is based on a python script to generate
the .h/.c files for you is this implementation contained in one single header file.
This is an outline to show how you can use the single header approach
and bend it to its absolute extrems. I tend to write specialized datastructures
for most of my problems but sometimes it happens that I have to use a particular
@tbutts
tbutts / tmux-migrate-options.py
Last active Jun 16, 2019
For tmux configs: Merge deprecated/removed -fg, -bg, and -attr options into the -style option
View tmux-migrate-options.py
#!/usr/bin/env python
# vim: set fileencoding=utf-8
#
# USAGE:
# Back up your tmux old config, run the script and redirect stdout to your conf
# file. Example:
#
# $ cp ~/.tmux.conf ~/.tmux.conf.orig
# $ python ./tmux-migrate-options.py ~/.tmux.conf.orig > ~/.tmux.conf
#
@mono0926
mono0926 / commit_message_example.md
Last active Jun 16, 2019
[転載] gitにおけるコミットログ/メッセージ例文集100
View commit_message_example.md
View orthodoxc++.md

Orthodox C++

What is Orthodox C++?

Orthodox C++ (sometimes referred as C+) is minimal subset of C++ that improves C, but avoids all unnecessary things from so called Modern C++. It's exactly opposite of what Modern C++ suppose to be.

Why not Modern C++?

@steinwaywhw
steinwaywhw / One Liner to Download the Latest Release from Github Repo.md
Last active Jun 16, 2019
One Liner to Download the Latest Release from Github Repo
View One Liner to Download the Latest Release from Github Repo.md
  • Use curl to get the JSON response for the latest release
  • Use grep to find the line containing file URL
  • Use cut and tr to extract the URL
  • Use wget to download it
curl -s https://api.github.com/repos/jgm/pandoc/releases/latest \
| grep "browser_download_url.*deb" \
| cut -d : -f 2,3 \
| tr -d \" \
@motleytech
motleytech / local smtp mail server in python
Created Apr 28, 2016
Running a local smtp mail server in Python
View local smtp mail server in python
python -m smtpd -n -c DebuggingServer localhost:25
@ivanskodje
ivanskodje / youtube-dl-download-pluralsight-videos.md
Last active Jun 16, 2019
youtube-dl for downloading pluralsight videos
View youtube-dl-download-pluralsight-videos.md

Downloading Videos from Pluralsight

Disclaimer

Pluralsight do not permit users to download their videos.
If you are an user of pluralsight you have agreed with their ToS,
and are thusly refrained from doing so.
Use this knowledge at your own risk.

youtube-dl for Windows

@boxingsquirrel
boxingsquirrel / libimobiledevice-build-without-root.sh
Created Feb 27, 2011
Build libimobiledevice from source easily...
View libimobiledevice-build-without-root.sh
echo "Building libplist..."
git clone http://cgit.sukimashita.com/libplist.git/ > /dev/null
cd libplist
mkdir build
cd build
cmake --prefix=/usr ..
make
sudo make install
cd ../../
@drhelius
drhelius / Game Boy Boot ROM Disassembly
Last active Jun 16, 2019
Game Boy Boot ROM Disassembly
View Game Boy Boot ROM Disassembly
LD SP,$fffe ; $0000 Setup Stack
XOR A ; $0003 Zero the memory from $8000-$9FFF (VRAM)
LD HL,$9fff ; $0004
Addr_0007:
LD (HL-),A ; $0007
BIT 7,H ; $0008
JR NZ, Addr_0007 ; $000a
LD HL,$ff26 ; $000c Setup Audio
@strothj
strothj / ResizeObserver.d.ts
Last active Jun 16, 2019
ResizeObserver TypeScript definition
View ResizeObserver.d.ts
interface Window {
ResizeObserver: ResizeObserver;
}
/**
* The ResizeObserver interface is used to observe changes to Element's content
* rect.
*
* It is modeled after MutationObserver and IntersectionObserver.
*/
You can’t perform that action at this time.