Skip to content

Instantly share code, notes, and snippets.

View davoclavo's full-sized avatar
🎯
Focusing

Davo davoclavo

🎯
Focusing
View GitHub Profile
@davoclavo
davoclavo / homejoy.md
Created March 17, 2013 20:28
Homejoy bug

In your updatePrice() function you get the number of hours out of the dropdown menu, but the maximum possible number of hours is 12.5. If you select several extras and a really large house, the number of hours becomes larger than the maximum possible at the dropdown, so it renders a wrong price.

This is the line that is causing trouble, you can either add more options to the dropdown or create a variable that stores the number of hours and it can either be changed through a dropdown change, or a change in cleaning service options (size, extras, etc):

var hours = parseFloat($("#num_hours_dropdown :selected").val());

Image

@davoclavo
davoclavo / vine.py
Created July 26, 2013 21:28
Vine API from Vino with added methods
# coding: utf-8
import json
import logging
import requests
BASE_URL = "https://api.vineapp.com/"
class VineError(Exception):
@davoclavo
davoclavo / inverted_internet.py
Last active November 22, 2021 15:50
Inverted internet for mitmproxy
#!/usr/bin/env python
"""
Inject inverting css
Usage:
inverted_internet
"""
from libmproxy import controller, proxy
import os
import sys
@davoclavo
davoclavo / gist:6695306
Last active December 23, 2015 21:19
vine's /static/style.css fix
// Line 99
// From this
-moz-box-shadow:inset 0 1px 0 rgba(255,255,255);
// To this
-moz-box-shadow:inset 0 1px 0 rgba(255,255,255,0.4);
@davoclavo
davoclavo / vine_hasher.rb
Last active October 15, 2016 20:56
tool to unhash/hash vine ids
module VineHasher
VINE_KEY = 'BuzaW7ZmKAqbhMOei5J1nvr6gXHwdpDjITtFUPxQ20E9VY3Ll'
VINE_KEY_SIZE = VINE_KEY.size
VINE_KEY_HASH = VINE_KEY.split('').each_with_index.inject({}) {|hash, (key, index)| hash[key] = index; hash }
def unhash_id(hashed_id)
hashed_id.reverse.split('').each_with_index.inject(0) { |total, (key, index)| total + VINE_KEY_HASH[key] * VINE_KEY_SIZE**index }
end
def hash_id(id)
https://docs.google.com/presentation/d/1Cxgs9sklnKU3KEBSVCLlDswFbYUjYYZciaMNF9ipVZU
@davoclavo
davoclavo / ConfigurableFirmata.ino
Created September 15, 2014 19:46
adding DHT11Feature
/*
* Firmata is a generic protocol for communicating with microcontrollers
* from software on a host computer. It is intended to work with
* any host computer software package.
*
* To download a host software package, please click on the following link
* to open the download page in your default browser.
*
* http://firmata.org/wiki/Download
*/
@davoclavo
davoclavo / core.clj
Last active September 3, 2019 20:51
courjera
(ns courjera.core
(:require [clj-http.client :as client]
[clojure.data.json :as json]
[clojure.string :as string]
[clj-time.core :as t]
[clj-time.format :as f]
[courjera.models :as m]
[clojure.java.io :as io]))
(System/setProperty "https.proxyHost" "localhost")
#! /bin/sh
# /etc/init.d/doorbot
### BEGIN INIT INFO
# Provides: doorbot
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Simple script to start doorbot

emacs --daemon to run in the background. emacsclient.emacs24 <filename/dirname> to open in terminal

NOTE: "M-m and SPC can be used interchangeably".

  • Undo - C-/
  • Redo - C-?
  • Change case: 1. Camel Case : M-c 2. Upper Case : M-u
  1. Lower Case : M-l