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;
@fcannizzaro
fcannizzaro / bintree.c
Last active November 20, 2020 06:43
Binary Tree C implementation
#include<stdio.h>
#include<stdlib.h>
#include<time.h>
#define TEST_NUMBER 100
typedef struct node{
struct node * l, * r;
int value;
} node;
@nop-90
nop-90 / mayaOnArchlinux.sh
Last active September 19, 2019 00:42 — forked from z3ntu/mayaOnUbuntu.sh
Shell script for installing Maya 2016 SP5 on Archlinux. Not tested yet, just copied the thing to know what to do when installing it.
#!/bin/bash
# Heith Seewald 2012
# Garoe Dorta 2015
# Luca Weiss 2015
# Also based on https://gist.github.com/MichaelLawton/ee27bf4a0f591bed19ac
# Feel free to extend/modify to meet your needs.
#### Lets run a few checks to make sure things work as expected.
#Make sure we’re running with root permissions.
if [ `whoami` != root ]; then
@rafalnowak
rafalnowak / .spacemacs
Created October 11, 2015 20:31
My current .spacemacs configuration
;; -*- mode: emacs-lisp -*-
;; This file is loaded by Spacemacs at startup.
;; It must be stored in your home directory.
(defun dotspacemacs/layers ()
"Configuration Layers declaration."
(setq-default
;; List of additional paths where to look for configuration layers.
;; Paths must have a trailing slash (i.e. `~/.mycontribs/')
dotspacemacs-configuration-layer-path '()
@tsiege
tsiege / The Technical Interview Cheat Sheet.md
Last active April 20, 2024 16:52
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

ANNOUNCEMENT

I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!






\

@todgru
todgru / starttmux.sh
Last active April 27, 2024 18:17
Start up tmux with custom windows, panes and applications running
#!/bin/sh
#
# Setup a work space called `work` with two windows
# first window has 3 panes.
# The first pane set at 65%, split horizontally, set to api root and running vim
# pane 2 is split at 25% and running redis-server
# pane 3 is set to api root and bash prompt.
# note: `api` aliased to `cd ~/path/to/work`
#
session="work"
@hubgit
hubgit / README.md
Last active May 2, 2024 10:55
Remove metadata from a PDF file, using exiftool and qpdf. Note that embedded objects may still contain metadata.

Anonymising PDFs

PDF metadata

Metadata in PDF files can be stored in at least two places:

  • the Info Dictionary, a limited set of key/value pairs
  • XMP packets, which contain RDF statements expressed as XML

PDF files

@tell-k
tell-k / paramiko_proxycommand_sample.py
Last active April 14, 2021 10:07
paramikoのProxyCommandのサンプル
#!/usr/bin/env python
#-*- coding:utf8 -*-
# paramiko の ProxyCommandの Sample
# -------------------------------------------------
#
# ~/.ssh/config
#
# Host proxy-server
# User hoge
@nikolaplejic
nikolaplejic / gist:3654637
Created September 6, 2012 10:36
How to copy/paste your password in PayPal's change password form
PayPal blocks copy/paste actions in their "change password" form,
citing some irrelevant security issues as the reason. That's a
load of crap, and they know it -- disabling copy/paste makes it a
lot harder to use a decent password generator and a lot easier to
screw up your pwd when retyping, especially if it's a long one
(as it should be!).
So, here's the quick'n'dirty way to use an externally generated
password in your PayPal account:
@bradmontgomery
bradmontgomery / dummy-web-server.py
Last active April 15, 2024 14:27
a minimal http server in python. Responds to GET, HEAD, POST requests, but will fail on anything else.
#!/usr/bin/env python
"""
Very simple HTTP server in python (Updated for Python 3.7)
Usage:
./dummy-web-server.py -h
./dummy-web-server.py -l localhost -p 8000
Send a GET request: