Skip to content

Instantly share code, notes, and snippets.

@fay59
fay59 / Quirks of C.md
Last active January 23, 2024 04:24
Quirks of C

Here's a list of mildly interesting things about the C language that I learned mostly by consuming Clang's ASTs. Although surprises are getting sparser, I might continue to update this document over time.

There are many more mildly interesting features of C++, but the language is literally known for being weird, whereas C is usually considered smaller and simpler, so this is (almost) only about C.

1. Combined type and variable/field declaration, inside a struct scope [https://godbolt.org/g/Rh94Go]

struct foo {
   struct bar {
 int x;
@EderSantana
EderSantana / CATCH_Keras_RL.md
Last active October 16, 2023 08:32
Keras plays catch - a single file Reinforcement Learning example
@CoachBirgit
CoachBirgit / divi-sticky-footer.css
Last active January 6, 2018 02:11
CSS: Sticky footer - Elegantthemes Divi
@vigorouscoding
vigorouscoding / DateFlowLayout.h
Created March 13, 2013 20:10
UICollectionView with sticky headers which works for horizontal as well as vertical scrolling
#import <UIKit/UIKit.h>
@interface DateFlowLayout : UICollectionViewFlowLayout
@end
@moshekaplan
moshekaplan / test_surf.py
Last active October 19, 2022 18:14
Demo for Python OpenCV SURF
#!/usr/bin/env python
'''
Uses SURF to match two images.
Based on the sample code from opencv:
samples/python2/find_obj.py
USAGE
find_obj.py <image1> <image2>
@sqshemet
sqshemet / ObjectMarker.py
Created July 29, 2012 03:00
Python implementation of OpenCV ObjectMarker
#!/usr/bin/python
###############################################################################
# Name : ObjectMarker.py
# Author : Python implementation: sqshemet
# Original ObjectMarker.cpp: http://www.cs.utah.edu/~turcsans/DUC_files/HaarTraining/
# Date : 7/24/12
# Description : Object marker utility to be used with OpenCV Haar training.
# Tested on Ubuntu Linux 10.04 with OpenCV 2.1.0.
# Usage : python ObjectMarker.py outputfile inputdirectory
@sekati
sekati / xcode-build-bump.sh
Created July 24, 2012 20:44
Xcode Auto-increment Build & Version Numbers
# xcode-build-bump.sh
# @desc Auto-increment the build number every time the project is run.
# @usage
# 1. Select: your Target in Xcode
# 2. Select: Build Phases Tab
# 3. Select: Add Build Phase -> Add Run Script
# 4. Paste code below in to new "Run Script" section
# 5. Drag the "Run Script" below "Link Binaries With Libraries"
# 6. Insure that your starting build number is set to a whole integer and not a float (e.g. 1, not 1.0)
//
// NSString+Levenshtein.h
// PyHelp
//
// Modified by Michael Bianco on 12/2/11.
// <http://mabblog.com>
//
// Created by Rick Bourner on Sat Aug 09 2003.
// rick@bourner.com
@alextp
alextp / online.py
Created October 22, 2011 00:19
A hacky, old, python implementation of leon bottou's lasvm
# coding: utf-8
"""Online learning."""
import numpy as np
from numpy import sign
import itertools as it
from numpy import array as A, zeros as Z
import math