Skip to content

Instantly share code, notes, and snippets.

@jhenly
jhenly / json_types.py
Created February 5, 2024 20:16
A few handy JSON types.
""" Includes a few handy JSON types.
```
JsonPrimitive = str | int | float | bool | None
Json = JsonPrimitive | dict[str, 'Json'] | list['Json']
JsonObject = dict[str, Json]
JsonArray = list[Json]
```
"""
@jhenly
jhenly / int_dll.c
Last active October 12, 2020 21:45
// int_dll.c
#include <stdio.h>
#include <stdlib.h>
// doubly linked list node struct
struct node {
int id;
struct node * prev;
struct node * next;
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package itcs3166_project;
/**
*
* @author Kyle1
@jhenly
jhenly / hosts
Last active January 29, 2016 14:24
/etc/hosts - An ongoing list of ad/stupid sites to block traffic from.
# /etc/hosts
127.0.0.1 localhost
# Block traffic from these ad sites:
#+ doubleclick domains
0.0.0.0 doubleclick.net
0.0.0.0 www.doubleclick.net
0.0.0.0 cm.g.doubleclick.net
0.0.0.0 www.cm.g.doubleclick.net
@jhenly
jhenly / RunEclipse.bat
Created April 23, 2015 11:49
Windows batch script to check three directories for Eclipse and launch it with my workspace, if it exists.
@ECHO OFF
:: Windows batch program to check three directories for Eclipse
:: and launch it with my workspace, if it exists.
SETLOCAL ENABLEEXTENSIONS
SET me=%~n0
SET parent=%~dp0
SET deskEclipse="C:\Users\Public\Desktop\Eclipse\eclipse-java-luna\eclipse"
SET progEclipse="%ProgramFiles:"=%\Eclipse\eclipse-java-luna\eclipse"