Skip to content

Instantly share code, notes, and snippets.

View tiesmaster's full-sized avatar

Thijs Brobbel tiesmaster

View GitHub Profile
{
"$schema": "https://aka.ms/terminal-profiles-schema",
"copyOnSelect": false,
"defaultProfile": "{574e775e-4f2a-5b96-ac1e-a2962a402336}",
// Add custom keybindings to this array.
// To unbind a key combination from your defaults.json, set the command to "unbound".
// To learn more about keybindings, visit https://aka.ms/terminal-keybindings
"keybindings":
[
// Copy and paste are bound to Ctrl+Shift+C and Ctrl+Shift+V in your defaults.json.
@heemskerkerik
heemskerkerik / DispatchBenchmark.cs
Created November 24, 2017 10:21
Benchmark of different double dispatch methods in C#
// depends on BenchmarkDotNet 0.10.10
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Attributes.Jobs;
using BenchmarkDotNet.Running;
@justincbagley
justincbagley / How_to_Convert_Markdown_to_PDF.md
Last active June 14, 2024 22:42
How To Convert Markdown to PDF

How to convert markdown to PDF:

This post reviews several methods for converting a Markdown (.md) formatted file to PDF, from UNIX or Linux machines.

Using Pandoc:

$ pandoc How_I_got_svg-resizer_working_on_Mac_OSX.md -s -o test1.pdf
@FabienDehopre
FabienDehopre / HarlemShakeScript.js
Last active April 21, 2022 17:53
Make an unsecure website dance
/*
(from Troy Hunt's article https://www.troyhunt.com/understanding-csp-the-video-tutorial-edition/)
1. Go to Google Chrome
2. Go to any website (works cool on facebook)
3. Right click anywhere -> Inspect Element
4. Click on the rightmost "Console" tab.
5. Copy paste the following * into the console.
6. Make sure the volume isn't too loud!
6. Press Enter.
public class Person
{
public Person(string name, int age)
{
this.Name = name;
this.Age = age;
}
public string Name { get; private set; }
public int Age { get; private set; }
@willurd
willurd / web-servers.md
Last active July 23, 2024 12:11
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@gnarf
gnarf / ..git-pr.md
Last active April 12, 2024 22:00
git pr - Global .gitconfig aliases for Pull Request Managment

Install

Either copy the aliases from the .gitconfig or run the commands in add-pr-alias.sh

Usage

Easily checkout local copies of pull requests from remotes:

  • git pr 4 - creates local branch pr/4 from the github upstream(if it exists) or origin remote and checks it out
  • git pr 4 someremote - creates local branch pr/4 from someremote remote and checks it out
@StevenLooman
StevenLooman / match.magik
Created July 20, 2012 18:59
The classic match(), version in Smallworld/Magik
#/* matchere: search for regexp at beginning of text */
#int matchhere(char *regexp, char *text) {
# if (regexp[0] == '\0')
# return 1;
# if (regexp[1] == '*')
# return matchstar(regexp[0], regexp+2, text);
# if (regexp[0] == '$' && regexp[1] == '\0')
# return *text == '\0';
# if (*text!='\0' && (regexp[0]=='.' || regexp[0]==*text))
# return matchhere(regexp+1, text+1);