Instantly share code, notes, and snippets.

Davide D'Agostino DAddYE

View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am daddye on github.
  • I am daddye (https://keybase.io/daddye) on keybase.
  • I have a public key whose fingerprint is 8F39 912A 097E 377E 1E00 32CD AF60 5C47 8698 A064

To claim this, I am signing this object:

View fix permissions brew.sh
cd /usr/local
sudo chown -R daddye:admin .
git init
git remote | while read i; do git remote remove $i; done
git reset --hard
git remote add -m master -t master -f --tags origin git://github.com/mxcl/homebrew.git
View The Technical Interview Cheat Sheet.md

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.
View example.rb
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
View randomID.go
package main
import (
"crypto/rand"
"math/big"
)
var maxID = new(big.Int).SetUint64(^uint64(0))
func genRandomID() uint64 {
View vim.md

CtrlP

<F5>  " to purge the cache for the current directory to get new files, remove deleted files and apply new ignore options.
<c-f> " and `<c-b>` to cycle between modes.
<c-d> " to switch to filename only search instead of full path.
<c-r> " to switch to regexp mode.
<c-t> " or `<c-v>`, `<c-x>` to open the selected entry in a new tab or in a new split.
<c-z> " to mark/unmark multiple files and `<c-o>` to open them.
View opencv.rb
require 'formula'
class Opencv < Formula
homepage 'http://opencv.org/'
url 'https://github.com/Itseez/opencv/archive/2.4.9.tar.gz'
sha1 'd16ced627db17f9864c681545f18f030c7a4cc0b'
# CUDA needs 2.4.10 (see #1228)
# url 'https://github.com/Itseez/opencv/archive/2.4.10.tar.gz'
# sha1 'a0c2d5944364fc4f26b6160b33c03082b1fa08c1'
head 'https://github.com/Itseez/opencv.git'
View chan.go
/*
This is an infinitely buffered channel.
*/
package main
import (
"fmt"
"sync"
"time"
)
View designer.html
<link rel="import" href="../core-scaffold/core-scaffold.html">
<link rel="import" href="../core-header-panel/core-header-panel.html">
<link rel="import" href="../core-menu/core-menu.html">
<link rel="import" href="../core-item/core-item.html">
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<link rel="import" href="../core-menu/core-submenu.html">
<link rel="import" href="../chart-js/chart-js.html">
<polymer-element name="my-element">
View designer.html
<link rel="import" href="../core-scaffold/core-scaffold.html">
<link rel="import" href="../core-header-panel/core-header-panel.html">
<link rel="import" href="../core-menu/core-menu.html">
<link rel="import" href="../core-item/core-item.html">
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<link rel="import" href="../core-menu/core-submenu.html">
<link rel="import" href="../chart-js/chart-js.html">
<polymer-element name="my-element">