This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* The MIT License (MIT) | |
* Copyright (c) <2016> <Brickgao> | |
* | |
* Permission is hereby granted, free of charge, to any person obtaininga | |
* copy of this software and associated documentation files (the "Software"), | |
* to deal in the Software without restriction, including without limitation | |
* the rights to use, copy, modify, merge, publish, distribute, sublicense, | |
* and/or sell copies of the Software, and to permit persons to whom the Software | |
* is furnished to do so, subject to the following conditions: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@startuml | |
' uncomment the line below if you're using computer with a retina display | |
' skinparam dpi 300 | |
!define Table(name,desc) class name as "desc" << (T,#FFAAAA) >> | |
' we use bold for primary key | |
' green color for unique | |
' and underscore for not_null | |
!define primary_key(x) <b>x</b> | |
!define unique(x) <color:green>x</color> | |
!define not_null(x) <u>x</u> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import geocoder | |
import requests | |
import unicodecsv as csv | |
import time | |
container = {} | |
g = geocoder.google("New Brunswick, Canada") | |
url = "https://www.realtor.ca/api/Listing.svc/PropertySearch_Post" | |
PropertySearchType = { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; 1) first goto https://console.developers.google.com/start/api?id=gmail | |
;; -- to turn on gmail api for your account | |
;; 2) then create a oauth consent with app name | |
;; 3) then add oauth clientid and download to ./clientsecret.json | |
;; 4) boot run | |
;; -- when running first time a browser will open to accept authorizaton | |
(set-env! :dependencies '[[com.google.apis/google-api-services-gmail "v1-rev34-1.21.0"] | |
[com.google.api-client/google-api-client "1.20.0"] | |
[com.google.oauth-client/google-oauth-client-jetty "1.20.0"]]) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Assuming an Ubuntu Docker image | |
$ docker run -it <image> /bin/bash |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function interval(func, wait, times){ | |
var interv = function(w, t){ | |
return function(){ | |
if(typeof t === "undefined" || t-- > 0){ | |
setTimeout(interv, w); | |
try{ | |
func.call(null); | |
} | |
catch(e){ | |
t = 0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns noprompt.cypher | |
(:require [clojure.string :as str] | |
[clojurewerkz.neocons.rest.cypher :as cy] | |
[clojure.walk :as walk]) | |
(:import java.lang.StringBuilder)) | |
;; Example usage: | |
(comment | |
;; Query: | |
(start {:n (node [3 1])} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Retrive old website from Google Cache. Optimized with sleep time, and avoid 504 error (Google block Ip send many request). | |
#Programmer: Kien Nguyen - QTPros http://qtpros.info/kiennguyen | |
#change search_site and search_term to match your requirement | |
#Original: http://www.guyrutenberg.com/2008/10/02/retrieving-googles-cache-for-a-whole-website/ | |
#!/usr/bin/python | |
import urllib, urllib2 | |
import re | |
import socket |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pi@raspberrypi ~ $ cat /etc/init/ssh_tunnel.conf | |
#!upstart | |
author "george" | |
description "SSH Tunnel" | |
start on stopped rc | |
stop on shutdown |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns pdfbox.core | |
(:import [org.apache.pdfbox.pdmodel PDDocument] | |
[org.apache.pdfbox.util PDFMarkedContentExtractor TextPosition] | |
[java.util ArrayList])) | |
(defn parse-pdf [filename] | |
(let [pages (.getAllPages (.getDocumentCatalog (PDDocument/load filename))) | |
textpool (ArrayList.) | |
extract-text (proxy [PDFMarkedContentExtractor] [] | |
(processTextPosition [text] |