Skip to content

Instantly share code, notes, and snippets.

View jonalmeida's full-sized avatar
🦊
making browsers..

Jonathan Almeida jonalmeida

🦊
making browsers..
View GitHub Profile
# HG changeset patch
# User Jonathan Almeida [:jonalmeida] <jalmeida@mozilla.com>
# Date 1437523313 25200
# Tue Jul 21 17:01:53 2015 -0700
# Node ID 8f1665e896e598b9f529c6b53943eb01ba0b534b
# Parent a6b93cceaf4e15a45d37cd5e75660cdc7d671b10
Bug 1184211 - Replace TwoWayView in SearchBar with RecyclerView. r?sebastian
diff --git a/mobile/android/base/home/BrowserSearch.java b/mobile/android/base/home/BrowserSearch.java
--- a/mobile/android/base/home/BrowserSearch.java
{
'submit_timestamp': 1436304039,
'build_system_type': 'taskcluster',
'machine_name': 'unknown',
'job_group_symbol': '?',
'job_group_name': 'unknown',
'platform_option': 'opt',
'job_type_description': 'fill me',
'signature': '3b3bb91e6817188cf0525fccac5be776207f234b',
'result_set_id': 58106,
@jonalmeida
jonalmeida / grab_email.py
Created March 12, 2015 01:57
Email grabbing from tab separated list
with open('windsor_bus_list.txt') as fp:
junk = fp.readline()
for line in iter(fp.readline, ''):
print line.split('\t')[2]
fp.close()
@jonalmeida
jonalmeida / app.js
Created February 13, 2015 22:00
Using pHash on Ron Paul
var pHash = require("phash");
/*
var hashA = pHash.imageHashSync("cat.jpg");
var hashB = pHash.imageHashSync("cat2.jpg");
console.log("Image hash of cat: ", hashA);
console.log("Image hash of cat2: ", hashA);
*/
var hashA = pHash.imageHashSync("ron_paul1.jpg");
var hashB = pHash.imageHashSync("ron_paul2.jpg");
@jonalmeida
jonalmeida / dlist.rs
Last active August 29, 2015 14:14 — forked from pythonesque/dlist.rs
use list::Node;
mod list {
use std::mem;
#[derive(Show)]
pub struct Node<T> {
pub data: T,
prev: Option<Box<Node<T>>>,
next: Option<Box<Node<T>>>
@jonalmeida
jonalmeida / HashTable.java
Last active August 29, 2015 14:12
Simple hash table in Java with add(), remove() and getElement()
package com.jonalmeida.HashTable;
public class HashTable<T> {
static final int DEFAULT_INITIAL_SIZE = 16;
private Node<T>[] table;
// Create a HashTable with an array size of `initialCapacity`.
public HashTable(int initialCapacity) {
if (initialCapacity < 0) {
throw new IllegalArgumentException("initialCapacity is of a negative number.");
@jonalmeida
jonalmeida / reverse_hash.cpp
Created November 29, 2014 02:29
ReverseTheHash
#include <iostream>
#include <string>
#include <inttypes.h>
int main( int argc, char *argv[] ) {
uint64_t h = 25180466553932;
std::string letters = "acdegilmnoprstuw";
std::string answer = "";
@jonalmeida
jonalmeida / vimrc
Created November 24, 2014 21:40
Current vim config
set ffs=unix,dos,mac " set file formats
set number " line numbers
set background=dark " background
colorscheme vividchalk " theme
"colorscheme molokai
"let g:molokai_original = 1
call pathogen#incubate()
call pathogen#helptags()
filetype off
syntax on

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

Business Models

Advertising

Models Examples
Display ads Yahoo!
Search ads Google