Skip to content

Instantly share code, notes, and snippets.

View ShawonAshraf's full-sized avatar
🐈

Shawon Ashraf ShawonAshraf

🐈
View GitHub Profile
@raymyers
raymyers / watchdir.py
Created October 25, 2011 00:17
Watch Directory For Changes (python)
import os, time, sys, fnmatch
path_to_watch = "D:/Projects/consumer-purchase-webapp/WebContent/js"
def findCoffeeFiles():
matches = []
for root, dirnames, filenames in os.walk(path_to_watch):
for filename in fnmatch.filter(filenames, '*.coffee'):
matches.append(os.path.join(root, filename))
return matches
@jimbojsb
jimbojsb / gist:1630790
Created January 18, 2012 03:52
Code highlighting for Keynote presentations

Step 0:

Get Homebrew installed on your mac if you don't already have it

Step 1:

Install highlight. "brew install highlight". (This brings down Lua and Boost as well)

Step 2:

@bazub
bazub / gist:3877971
Created October 12, 2012 08:17
Grayscale/Binary images using PIL
im=Image.open("1.jpg")
#im=im.rotate(1)
im.save("e.jpg")
im2=im.convert("L")
im2.save("b.jpg")
threshold = 100
im = im2.point(lambda p: p > threshold and 255)
im.save("d.jpg")
img="d.jpg"
result = tesseract.ProcessPagesWrapper(img,api)
@graph1zzlle
graph1zzlle / JSroadmaps.md
Last active November 30, 2017 20:27
Javascript + NodeJS + BackboneJS Learning Roadmap
@jordanconductor
jordanconductor / google-doc
Created September 15, 2013 22:08
Google Doc document embed
<div style="text-align: center;">
<iframe height="800" src="https://docs.google.com/document/d/1Z_i6cPWHLEv1AomflaVn4aG7_mYBRyJ7EhpcxiV17x4/pub?embedded=true" width="650"></iframe>
</div>
@nickrussler
nickrussler / gist:7527851
Created November 18, 2013 13:39
Convert Date String to/from ISO 8601 respecting UTC in Java
public static String toISO8601UTC(Date date) {
TimeZone tz = TimeZone.getTimeZone("UTC");
DateFormat df = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm'Z'");
df.setTimeZone(tz);
return df.format(date);
}
public static Date fromISO8601UTC(String dateStr) {
TimeZone tz = TimeZone.getTimeZone("UTC");
DateFormat df = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm'Z'");
@cgranade
cgranade / mathjax-gist.user.js
Created January 4, 2014 23:48
Adds MathJax support to GitHub Gists. Useful for working with Markdown documents.
// ==UserScript==
// @name MathJax for Gists
// @include *://gist.github.com/*
// @version 0.1
// @description Adds MathJax support to Gists.
// ==/UserScript==
if ((window.unsafeWindow == null ? window : unsafeWindow).MathJax == null) {
var script = document.createElement("script");
script.type = "text/javascript";
@pagreczner
pagreczner / stopwords.js
Created April 22, 2014 18:37
stop words
var stopwords = ["a", "a's", "able", "about", "above", "according", "accordingly", "across", "actually", "after", "afterwards", "again", "against", "ain't", "all", "allow", "allows", "almost", "alone", "along", "already", "also", "although", "always", "am", "among", "amongst", "an", "and", "another", "any", "anybody", "anyhow", "anyone", "anything", "anyway", "anyways", "anywhere", "apart", "appear", "appreciate", "appropriate", "are", "aren't", "around", "as", "aside", "ask", "asking", "associated", "at", "available", "away", "awfully", "be", "became", "because", "become", "becomes", "becoming", "been", "before", "beforehand", "behind", "being", "believe", "below", "beside", "besides", "best", "better", "between", "beyond", "both", "brief", "but", "by", "c'mon", "c's", "came", "can", "can't", "cannot", "cant", "cause", "causes", "certain", "certainly", "changes", "clearly", "co", "com", "come", "comes", "concerning", "consequently", "consider", "considering", "contain", "containing", "contains", "correspondi
@staltz
staltz / introrx.md
Last active June 6, 2024 03:19
The introduction to Reactive Programming you've been missing
@dpryden
dpryden / ClassLoaderLeakExample.java
Created October 20, 2014 00:01
Example of a ClassLoader leak in Java
import java.io.IOException;
import java.net.URLClassLoader;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.nio.file.Path;
/**
* Example demonstrating a ClassLoader leak.
*
* <p>To see it in action, copy this file to a temp directory somewhere,