Skip to content

Instantly share code, notes, and snippets.

// Uncompressed version of
// https://gist.github.com/munificent/b1bcd969063da3e6c298be070a22b604
#include <time.h> // Robert Nystrom
#include <stdio.h> // @munificentbob
#include <stdlib.h> // for Ginny
#include <stdbool.h> // 2008-2019
const int HEIGHT = 40;
const int WIDTH = 80;
@Davidslv
Davidslv / find-unused-ruby-methods.sh
Last active December 1, 2016 09:18 — forked from joelittlejohn/find-unused-clj.sh
find unused code..
#!/bin/bash
for f in $(egrep -o -R "def?-? [^ ]*" * --include '*.rb' | cut -d \ -f 2 | sort | uniq); do
echo $f $(grep -R --include '*.rb' -- "$f" * | wc -l);
done | grep " 1$"
---
- "/government/statistics/announcements/deaths-registered-by-area-of-usual-residence-in-england-and-wales-monthly-provisional-july-2014"
@Davidslv
Davidslv / The Technical Interview Cheat Sheet.md
Created October 16, 2015 00:15 — forked from tsiege/The Technical Interview Cheat Sheet.md
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

Studying for a Tech Interview Sucks, so Here's a Cheat Sheet to Help

This list is meant to be a both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth. It also will be available as a gist on Github for everyone to edit and add to.

Data Structure Basics

###Array ####Definition:

  • Stores data elements based on an sequential, most commonly 0 based, index.
  • Based on tuples from set theory.
/* Exercise: Loops and Functions #43 */
package main
import (
"fmt"
"math"
)
func Sqrt(x float64) float64 {
z := float64(2.)
Skipping some of the very basic commands, to use this cheat sheet you need atleast some vim knowledge.
; # repeat last search done using f
, # undo last search done using f
u # undo last change
ctrl+r # redo last change
:%s/t/r/g # replace all 't' by 'r'
~ # change case
gu # to lower case
gU # to upper case