Skip to content

Instantly share code, notes, and snippets.

View dmsurti's full-sized avatar
💭
I may be slow to respond.

Deepak Surti dmsurti

💭
I may be slow to respond.
View GitHub Profile
@avar
avar / 30-income-calculon.pl
Last active February 12, 2024 18:34
Calculate your income in The Netherlands with and without a 30% ruling.
# To check if this is up-to-date with the tax rates go to
# http://www.expatax.nl/tax-rates-2016.php and see if there's anything
# newer there.
#
# I make no guarantees that any of this is correct. I calculated this
# at the time and have been updating it when new tax rates come along
# because people keep finding this useful.
#
# There's also an interactive JS version of this created by
# @stevermeister at
@tuzz
tuzz / github.css
Last active June 5, 2024 02:29
Github Markdown Stylesheet
/*
Copyright (c) 2017 Chris Patuzzo
https://twitter.com/chrispatuzzo
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@brycelelbach
brycelelbach / zero_copy_archives.cpp
Created October 14, 2012 15:07
Zero Copy with Boost.Asio/Boost.Serialization
// Copyright (c) 2012 Bryce Adelstein-Lelbach
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
// hpx::util::container_device can be found here:
// http://raw.github.com/STEllAR-GROUP/hpx/master/hpx/util/container_device.hpp
// The portable binary archives used can be found here:
// http://raw.github.com/STEllAR-GROUP/hpx/master/hpx/util/portable_binary_oarchive.hpp
@dashed
dashed / github-pandoc.css
Created September 26, 2013 13:42
GitHub-like CSS for pandoc standalone HTML files (perfect for HTML5 output). Based on Marked.app's GitHub CSS. Added normalize.css (v2.1.3) in the prior to GitHub css.
/*! normalize.css v2.1.3 | MIT License | git.io/normalize */
/* ==========================================================================
HTML5 display definitions
========================================================================== */
/**
* Correct `block` display not defined in IE 8/9.
*/
set cot=menu,menuone
ino <BS> <BS><C-r>=getline('.')[col('.')-3:col('.')-2]=~#'\k\k'?!pumvisible()?"\<lt>C-n>\<lt>C-p>":'':pumvisible()?"\<lt>C-y>":''<CR>
inoremap <expr> <CR> pumvisible() ? "\<C-y>" : ""
inoremap <expr> <Tab> pumvisible() ? "\<C-n>" : "\<Tab>"
inoremap <expr> <S-Tab> pumvisible() ? "\<C-p>" : "\<S-Tab>"
function! s:skinny_insert(char)
if !pumvisible() && !exists('s:skinny_complete') &&
\ getline('.')[col('.') - 2].a:char =~# '\k\k'
@Jerdak
Jerdak / example_usage.py
Last active February 13, 2022 16:32
3-Dimensional (3D) file format based on Google's protobuf API.
#!/usr/bin/python
# -*- coding: utf-8 -*-
from __future__ import print_function
import mesh_pb2 as pobj
def dump_mesh(mesh):
""" Dump mesh data up to, at most, 10 vertices
and 10 faces.
The 10 vert/face limit is simply to limit
@szydan
szydan / gist:b225749445b3602083ed
Last active June 19, 2024 13:13
<U+FEFF> character showing up in files. How to remove them?
1) In your terminal, open the file using vim:
vim file_name
2) Remove all BOM characters:
:set nobomb
3) Save the file:
:wq
@daltheman
daltheman / NSData+Compression.swift
Created June 18, 2015 04:32
Simple Swift NSData Extension that shows how to use Apple LZFSE Compression Algorithm
/*
NSData+Compression.swift
Created by Danilo Altheman on 17/06/15.
The MIT License (MIT)
Copyright © 2015 Quaddro - Danilo Altheman. All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
@kristopolous
kristopolous / hn_seach.js
Last active July 24, 2023 04:12
hn job query search
// Usage:
// Copy and paste all of this into a debug console window of the "Who is Hiring?" comment thread
// then use as follows:
//
// query(term | [term, term, ...], term | [term, term, ...], ...)
//
// When arguments are in an array then that means an "or" and when they are seperate that means "and"
//
// Term is of the format:
// ((-)text/RegExp) ( '-' means negation )
@vasanthk
vasanthk / System Design.md
Last active June 22, 2024 10:42
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?