Skip to content

Instantly share code, notes, and snippets.

View IanTrudel's full-sized avatar

Ian Trudel IanTrudel

  • Ian Trudel Software Designer
View GitHub Profile
@theabbie
theabbie / Dijkstra.c
Last active April 15, 2024 02:27
Dijkstra's Shortest path algorithm in C
#include <stdio.h>
#define MAX 20
#define INF 1000
typedef struct {
int predecessor;
int distance;
int status;
int neighbours[MAX];
} Node;

ZSH CheatSheet

This is a cheat sheet for how to perform various actions to ZSH, which can be tricky to find on the web as the syntax is not intuitive and it is generally not very well-documented.

Strings

Description Syntax
Get the length of a string ${#VARNAME}
Get a single character ${VARNAME[index]}
@harieamjari
harieamjari / kpa.c
Last active October 2, 2023 03:10
An implementation of Karplus-Strong Algorithm in C. Using /dev/urandom in linux.
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <time.h>
#define SECONDS 6 /* you can change this to suit for your preferences */
#define LENGTH 300 /* you can experiment with different string length */
char wav_struct[] = {
'R', 'I', 'F', 'F',
@mdamien
mdamien / 0readme
Created July 26, 2020 07:21
Twitter Calendar View of user tweets
tweets.csv comes from `twint -u dam_io --csv -o tweets.csv`
@huytd
huytd / todo.vim
Created June 14, 2020 07:34
A Todo list syntax in Vim, with an actual checkbox
" Vim syntax file
" Language: Todo
" Maintainer: Huy Tran
" Latest Revision: 14 June 2020
if exists("b:current_syntax")
finish
endif
" Custom conceal
@YukiSnowy
YukiSnowy / main.cpp
Last active March 20, 2024 19:10
example SDL2 Vulkan application
// g++ *.cpp -o vulkan -lSDL2main -lSDL2 -lvulkan-1
// https://vulkan-tutorial.com/
#include <iostream>
using namespace std;
#include <SDL2/SDL.h>
SDL_Window *window;
char* window_name = "example SDL2 Vulkan application";
import cv2
import numpy as np
#from skimage.measure import compare_ssim
from skimage.metrics import structural_similarity
import click
@click.command()
@click.option("-o" , "--output" , default = None , type=str , help = "Output File")
@click.argument("image1" , type = str)
@suhdonghwi
suhdonghwi / main.py
Created April 6, 2020 11:42
Analyzing a paradigm relationship between programming languages by parsing wikipedia documents
import requests
from bs4 import BeautifulSoup
import re
import graph_tool.all as gt
def get_html_content(url):
r = requests.get(url)
return r.text
inf_by_regex = re.compile('Influenced by')
@lunacookies
lunacookies / syntax_ideas.md
Last active May 7, 2020 01:37
Some Syntax Ideas

What is this?

I’m working on a new language (Fjord) for a shell (fj). Although I have some ideas of my own for syntax, I’m not sure if they’re a really bad idea or if they’re fine, so I’ve decided to conduct a ‘sanity check’ of sorts by writing some preliminary ideas down here. Please respond down in the comments with any thoughts you have!

General philosophy

Note: throughout this document I’ll refer to functions, which are what I’m calling commands.

As this is a language for a shell,

@shakna-israel
shakna-israel / LetsDestroyC.md
Created January 30, 2020 03:50
Let's Destroy C

Let's Destroy C

I have a pet project I work on, every now and then. CNoEvil.

The concept is simple enough.

What if, for a moment, we forgot all the rules we know. That we ignore every good idea, and accept all the terrible ones. That nothing is off limits. Can we turn C into a new language? Can we do what Lisp and Forth let the over-eager programmer do, but in C?