Skip to content

Instantly share code, notes, and snippets.

View priyatam's full-sized avatar

Priyatam Mudi priyatam

View GitHub Profile
@dannguyen
dannguyen / aws-textract-sample-readme.md
Last active October 30, 2023 05:49
A gist of AWS Textract sample/demo data for easy reference and preview, in case you're curious how well Amazon does when it comes to pdf-to-csv

AWS Textract -- sample document image and data from the offical demo

AWS Textract is now out of closed beta. You can read the features page here, and you can also read about its limits here (e.g. no handwriting). Basically, if you've ever had to deal with the hell of getting structured data out of a PDF (scanned image or not), Textract is aiming for your business:

image

This short gist contains some of my brief observations about Textract and its demo, as well as direct links to the most relevant and important files, such as the Textract demo sample image and the resulting data files from Textract's API. If you have an AWS account, I h

@ftrain
ftrain / rhymes.clj
Last active July 14, 2023 22:20
Annotated rhyming dictionary
;; This is at: https://gist.github.com/8655399
;; So we want a rhyming dictionary in Clojure. Jack Rusher put up
;; this code here:
;;
;; https://gist.github.com/jackrusher/8640437
;;
;; I'm going to study this code and learn as I go.
;;
;; First I put it in a namespace.
@DmitrySoshnikov
DmitrySoshnikov / python-closures.py
Created November 15, 2010 12:03
Understanding Python's closures
# "Understanding Python's closures".
#
# Tested in Python 3.1.2
#
# General points:
#
# 1. Closured lexical environments are stored
# in the property __closure__ of a function
#
# 2. If a function does not use free variables
@gordonbrander
gordonbrander / webvr-daydream.md
Last active January 31, 2023 22:21
How to get WebVR working with Daydream

How to get WebVR working with your brand-new Daydream View & Pixel.

  1. Update Daydream app to latest (Play Store)
  2. Update Chrome app to latest (Play Store)
    • Tip: if you're feeling brave, download Chrome Canary instead. Better perf and new features.
  3. Update Google VR Services (Play Store)
  4. Open chrome://flags/#enable-webvr
    • Click "Enable"
  5. Open chrome://flags/#enable-vr-shell
    • Set dropdown to "Enabled"
@sander
sander / index.html
Created August 10, 2014 23:54
p5.js in ClojureScript
<!doctype html>
<style>body { padding: 0; }</style>
<script src='https://cdn.jsdelivr.net/p5.js/0.3.2/p5.min.js'></script>
<script src='out/goog/base.js'></script>
<script src='myproject.js'></script>
<script>goog.require('myproject.core')</script>
@bhauman
bhauman / core.cljs
Last active August 16, 2022 12:08
Helpful patterns when developing with ClojureScript Figwheel and Express js
(ns todo-server.core
(:require
[cljs.nodejs :as nodejs]
[figwheel.client :as fw]))
(nodejs/enable-util-print!)
(defonce express (nodejs/require "express"))
(defonce serve-static (nodejs/require "serve-static"))
(defonce http (nodejs/require "http"))
@christian-oudard
christian-oudard / gfm.py
Created June 29, 2010 18:51
Github Flavored Markdown in Python
import re
from hashlib import md5
def gfm(text):
# Extract pre blocks.
extractions = {}
def pre_extraction_callback(matchobj):
digest = md5(matchobj.group(0)).hexdigest()
extractions[digest] = matchobj.group(0)
return "{gfm-extraction-%s}" % digest
@ptaoussanis
ptaoussanis / transducers.clj
Last active December 17, 2021 13:54
Quick recap/commentary: Clojure transducers
(comment ; Fun with transducers, v2
;; Still haven't found a brief + approachable overview of Clojure 1.7's new
;; transducers in the particular way I would have preferred myself - so here goes:
;;;; Definitions
;; Looking at the `reduce` docstring, we can define a 'reducing-fn' as:
(fn reducing-fn ([]) ([accumulation next-input])) -> new-accumulation
;; (The `[]` arity is actually optional; it's only used when calling
;; `reduce` w/o an init-accumulator).
@cgrand
cgrand / restrict-map.clj
Created May 29, 2012 10:15
Restricting nested maps to keys of interest
;; I could have used a closed dispatch (aka cond) but you may find this version more enjoyable
;; the spec format is the one provided by BG
(defprotocol Selector
(-select [s m]))
(defn select [m selectors-coll]
(reduce conj {} (map #(-select % m) selectors-coll)))
(extend-protocol Selector
@johanthoren
johanthoren / Dockerfile
Last active August 12, 2021 16:48
Build statically linked Graal-VM native-image using Make and Docker. Go through all TODO-steps!
FROM clojure:lein AS build
# TODO: Make sure to replace "foo" with actual value before running this!
ENV BIN_NAME="foo"
# The current versions to build against:
ENV MUSL_VERSION="1.2.2"
ENV ZLIB_VERSION="1.2.11"
ENV GRAALVM_VERSION="21.2.0"