Skip to content

Instantly share code, notes, and snippets.

View hagope's full-sized avatar

Omar Al-Jadda hagope

  • Sunnyvale, CA
View GitHub Profile
@hagope
hagope / dash-listen-3.py
Last active November 21, 2015 20:26 — forked from courtsimas/dash-listen-3.py
listen on network for push of Amazon dash button; this version uses arp-scan instead of scapy
import subprocess
import requests
import time
import os,sys
MAGIC_FORM_URL = 'http://api.cloudstitch.io/...your_url'
def record_wake():
data = {
"Timestamp": time.strftime("%Y-%m-%d %H:%M"),
// Solution 1:
Timestamp = ConvertToLocalTime(Date(MakeDate(1970, 1, 1) + (<timestamp_field> / 86400)), '<time_zone>')
// Solution 2:
Timestamp = ConvertToLocalTime(Date(25569 + (<timestamp_field> / 86400)), '<time_zone>')
// my need
ConvertToLocalTime(Date(MakeDate(1970, 1, 1) + (epoch_ts / 86400)))

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

@hagope
hagope / pt_stalk replication delay
Last active December 27, 2015 10:28 — forked from silviabotros/pt_stalk replication delay
Getting the Seconds_Behind_Master status from MySQL
mysql -h localhost -u root -e "show slave status\G" | grep "Seconds_Behind_Master" | awk '{print $2}'
iPad
1024 × 690 In landscape on iOS 4.3
1024 × 672 In landscape on iOS 5
768 × 946 In portrait on iOS 4.3
768 × 928 In portrait on iOS 5
1024 × 660 Always showing bookmarks bar in landscape on iOS 4.3
1024 × 644 Always showing bookmarks bar in landscape on iOS 5
768 × 916 Always showing bookmarks bar in portrait on iOS 4.3