Skip to content

Instantly share code, notes, and snippets.

View usametov's full-sized avatar

Ulan Sametov usametov

  • Asta Nova Enterprise Solutions
View GitHub Profile
@minhajuddin
minhajuddin / README.md
Created December 21, 2011 03:29
Script to retrieve content from google cache
@KRD1
KRD1 / mRunif.c
Created April 26, 2012 23:05 — forked from Sharpie/mRunif.c
An example of calling R functions from C
//myRunif.c
#include <R.h>
#include <Rinternals.h>
SEXP myRunif( SEXP n, SEXP min, SEXP max ){
SEXP statsPackage;
PROTECT(
statsPackage = eval( lang2( install("getNamespace"),
ScalarString(mkChar("stats")) ),
@jackrusher
jackrusher / gist:3182488
Created July 26, 2012 14:49
Fetching PDF text with attributes in Clojure using PDFBox
(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]
@georgeredinger
georgeredinger / tunnels
Created July 31, 2012 21:50
raspberrypi reverse ssh tunnel upstart scripts
pi@raspberrypi ~ $ cat /etc/init/ssh_tunnel.conf
#!upstart
author "george"
description "SSH Tunnel"
start on stopped rc
stop on shutdown
@qtproduction
qtproduction / scrape.py
Created September 26, 2012 12:41
Retrive website from Google Cache without blocking IP
#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
@noprompt
noprompt / cypher-dsl.clj
Last active March 24, 2023 15:57
A Clojure Cypher query DSL compatible with neocons.
(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])}
@richardkundl
richardkundl / setInterval.js
Created November 27, 2013 10:42
An alternative to Javascript's evil setInterval: - Doesn't care whether the callback is still running or not - Ignores errors - Isn't that flexible Thanks: http://www.thecodeship.com/web-development/alternative-to-javascript-evil-setinterval/
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;
@mitchwongho
mitchwongho / Docker
Last active September 23, 2024 12:09
Docker 'run' command to start an interactive BaSH session
# Assuming an Ubuntu Docker image
$ docker run -it <image> /bin/bash
@bartojs
bartojs / build.boot
Last active March 23, 2023 11:29
gmail rest api java/clojure example with oauth2 and labels
;; 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"]])
@DenisCarriere
DenisCarriere / mls.py
Created December 14, 2015 19:04
MLS Scraper
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 = {