Skip to content

Instantly share code, notes, and snippets.

View cristoper's full-sized avatar

chris cristoper

View GitHub Profile
@klange
klange / _.md
Last active September 27, 2024 11:04
It's a résumé, as a readable and compilable C source file. Since Hacker News got here, this has been updated to be most of my actual résumé. This isn't a serious document, just a concept to annoy people who talk about recruiting and the formats they accept résumés in. It's also relatively representative of my coding style.

Since this is on Hacker News and reddit...

  • No, I don't distribute my résumé like this. A friend of mine made a joke about me being the kind of person who would do this, so I did (the link on that page was added later). My actual résumé is a good bit crazier.
  • I apologize for the use of _t in my types. I spend a lot of time at a level where I can do that; "reserved for system libraries? I am the system libraries".
  • Since people kept complaining, I've fixed the assignments of string literals to non-const char *s.
  • My use of type * name, however, is entirely intentional.
  • If you're using an older compiler, you might have trouble with the anonymous unions and the designated initializers - I think gcc 4.4 requires some extra braces to get them working together. Anything reasonably recent should work fine. Clang and gcc (newer than 4.4, at le
@willurd
willurd / web-servers.md
Last active October 18, 2024 12:42
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
@fzerorubigd
fzerorubigd / i3config
Created August 1, 2013 12:43
my i3 config
# This file has been auto-generated by i3-config-wizard(1).
# It will not be overwritten, so edit it as you like.
#
# Should you change your keyboard layout somewhen, delete
# this file and re-run i3-config-wizard(1).
#
# i3 config file (v4)
#
# Please see http://i3wm.org/docs/userguide.html for a complete reference!
@xem
xem / codegolf.md
Last active August 1, 2024 14:30
JS code golfing

codegolf JS

Mini projects by Maxime Euzière (xem), subzey, Martin Kleppe (aemkei), Mathieu Henri (p01), Litterallylara, Tommy Hodgins (innovati), Veu(beke), Anders Kaare, Keith Clark, Addy Osmani, bburky, rlauck, cmoreau, maettig, thiemowmde, ilesinge, adlq, solinca, xen_the,...

(For more info and other projects, visit http://xem.github.io)

(Official Slack room: http://jsgolf.club / join us on http://register.jsgolf.club)

EDIT from 2019: Hi folks. I wrote this gist for myself and some friends, and it seems like it's gotten posted somewhere that's generated some (ahem, heated) discussion. The whitespace was correct when it was posted, and since then GitHub changed how it formats <pre> tags. Look at the raw text if you care about this. I'm sure someone could tell me how to fix it, but (thank you @anzdaddy for suggesting a formatting workaround) honestly this is a random throwaway gist from 2015, and someone more knowledgable about this comparison should just write a proper blog post about it. If you comment here I'll hopefully see it and stick a link to it up here. Cheers. @oconnor663

Here's the canonical TOML example from the TOML README, and a YAML version of the same.

title = "TOML Example"
 
@drj11
drj11 / ASCII.md
Last active October 23, 2022 03:35
How to memorise ASCII

How to memorise ASCII

You don't need to memorise ASCII as there is a handy chart available by typing man ascii in a Terminal. However, you may find it useful to remember some fun facts about ASCII.

Blocks of 32 are useful. 32 is 2⁵ (2 raised to the power 5) and a block of 32 is enough to represent all 26 common english letters plus some extra stuff.

ASCII is a coding for the first 128 numbers. 0 to 127.

@jblang
jblang / C64.md
Last active June 14, 2024 13:19
C64 Resources

Emulators

VICE is the best by such a commanding margin that you really needn't look elsewhere. Open source and has the largest community.

However, other options are:

  • CCS64, Lots of features, but I found it to be painfully slow. Shareware.
  • Hoxs64. Decent, but not as full-featured as VICE. The ML monitor seems nice.
  • Frodo is pretty outdated and the author admits as much.
  • micro64 seems promising but incomplete.
@romainl
romainl / pseudo-text-objects.vim
Last active August 13, 2024 16:10
Custom pseudo-text objects
" 24 simple pseudo-text objects
" -----------------------------
" i_ i. i: i, i; i| i/ i\ i* i+ i- i#
" a_ a. a: a, a; a| a/ a\ a* a+ a- a#
" can take a count: 2i: 3a/
for char in [ '_', '.', ':', ',', ';', '<bar>', '/', '<bslash>', '*', '+', '-', '#' ]
execute "xnoremap i" . char . " :<C-u>execute 'normal! ' . v:count1 . 'T" . char . "v' . (v:count1 + (v:count1 - 1)) . 't" . char . "'<CR>"
execute "onoremap i" . char . " :normal vi" . char . "<CR>"
execute "xnoremap a" . char . " :<C-u>execute 'normal! ' . v:count1 . 'F" . char . "v' . (v:count1 + (v:count1 - 1)) . 'f" . char . "'<CR>"
execute "onoremap a" . char . " :normal va" . char . "<CR>"
@romainl
romainl / autocommands.md
Last active March 20, 2022 08:26
Dealing with autocommands

Dealing with autocommands

Anatomy of a minimal autocommand

autocmd BufNewFile,BufRead *.foo set filetype=html
  • BufNewFile,BufRead is the list of events that trigger this autocommand.
  • *.foo is the pattern we want to match against the data returned by the event.
  • set filetype=html is the command we want to execute when the pattern matches the data returned by the event.
@romainl
romainl / vanilla-linter.md
Last active August 27, 2024 17:34
Linting your code, the vanilla way

Linting your code, the vanilla way

You may want a linter plugin to lint your code in Vim but you probably don't need it. At least try the built-in way before jumping on the plugin bandwagon.

Defining makeprg

autocmd FileType <filetype> setlocal makeprg=<external command>

This autocommand tells Vim to use <external command> when invoking :make % in a <filetype> buffer. You can add as many similar lines as needed for other languages.