Skip to content

Instantly share code, notes, and snippets.

View DAddYE's full-sized avatar

Davide D'Agostino DAddYE

  • Uber
  • San Francisco
View GitHub Profile
@DAddYE
DAddYE / .gitconfig
Last active October 22, 2023 11:54 — forked from mudphone/.gitconfig
A simple .gitconfig file.
[user]
name = DAddYE
email = info@daddye.it
[alias]
co = checkout
st = status
ci = commit
br = branch
sm = submodule
lg = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit
@DAddYE
DAddYE / The Technical Interview Cheat Sheet.md
Last active March 10, 2022 20:17 — 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.
@DAddYE
DAddYE / example.rb
Last active August 29, 2015 14:26 — forked from hamin/example.rb
An updated Rust 1.x version of Yehuda's Native Rust Extension post here http://blog.skylight.io/bending-the-curve-writing-safe-fast-native-gems-with-rust/
require "./points"
p1 = RustPoint::make_point(10, 10) # => #<Fiddle::Pointer:0x007f8231e56510 ptr=0x0000010b824000 size=0 free=0x00000000000000>
p2 = RustPoint::make_point(20, 20) # => #<Fiddle::Pointer:0x007f8231f20970 ptr=0x0000010b824010 size=0 free=0x00000000000000>
RustPoint::get_distance(p1, p2) # => 14.142135623730951

Learn you a Haskell - In a nutshell

This is a summary of the "Learn You A Haskell" online book under http://learnyouahaskell.com/chapters.


1. Introduction

  • Haskell is a functional programming language.
class HTTPRouter
self()
self.routes = { }
end
add(verb = String, path = String, func = Function)
self.routes[#self.routes + 1] = Route(verb, path, func)
end
match(verb, path)
for i=1, #self.routes do
m, q = self.routes[i].match(verb, path)

Description

This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.

The script is here:

#!/bin/bash
convert $1 -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 $2

Results

@DAddYE
DAddYE / gist:8721292
Created January 30, 2014 22:22 — forked from tmm1/gist:8393897
Ruby 2.1.0 in Production: known bugs and patches
Last week, we upgraded the github.com rails app to ruby 2.1.0 in production.
While testing the new build for rollout, we ran into a number of bugs. Most of
these have been fixed on trunk already, but I've documented them below to help
anyone else who might be testing ruby 2.1 in production.
@naruse I think we should backport these patches to the ruby_2_1 branch and
release 2.1.1 sooner rather than later, as some of the bugs are quite critical.
I'm happy to offer any assistance I can to expedite this process.
###
# Execute tests in parallel using multiple processes. Uses DRb to communicate
# between processes over a unix socket.
gem 'minitest', '~> 5.1.0'
require 'minitest'
require 'minitest/spec'
require 'minitest/mock'
require 'drb'
require 'drb/unix'
require 'fiddle'
require 'fiddle/import'
module GVL
include Fiddle
extend Importer
dlload Handle::DEFAULT
T = import_function 'rb_thread_call_without_gvl', TYPE_VOIDP,
For each Ruby module/class, we have Ruby methods on the left and the equivalent
Clojure functions and/or relevant notes are on the right.
For clojure functions, symbols indicate existing method definitions, in the
clojure namespace if none is explicitly given. clojure.contrib.*/* functions can
be obtained from http://github.com/kevinoneill/clojure-contrib/tree/master,
ruby-to-clojure.*/* functions can be obtained from the source files in this
gist.
If no method symbol is given, we use the following notation: