Skip to content

Instantly share code, notes, and snippets.

View bobbigmac's full-sized avatar

Bob Davies bobbigmac

View GitHub Profile
@terrancesnyder
terrancesnyder / regex-japanese.txt
Created November 7, 2011 14:05
Regex for Japanese
Regex for matching ALL Japanese common & uncommon Kanji (4e00 – 9fcf) ~ The Big Kahuna!
([一-龯])
Regex for matching Hirgana or Katakana
([ぁ-んァ-ン])
Regex for matching Non-Hirgana or Non-Katakana
([^ぁ-んァ-ン])
Regex for matching Hirgana or Katakana or basic punctuation (、。’)
@zph
zph / photo_to_scan.rb
Created April 26, 2012 00:49
Script to transform images to scanned documents (In Progress)
#!/usr/bin/env ruby
#
# Author : tevic@civet.ws
# License: MIT
# Function: Wrapper for unpaper & imagemagick to allow easy conversions
# Date 2012.04.06
# Credits:
# Requirements:
# Linux
# unpaper
@jpanganiban
jpanganiban / gist:3844261
Created October 6, 2012 07:05
Pygame + OpenCV Real-time Face Detection
#!/usr/bin/env python
from pygame import camera
import pygame
import time
import cv
import os
# Recognition
@matshofman
matshofman / gist:4150213
Created November 26, 2012 19:48
Star data to JSON
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace RADECtoALTAZ
@sevastos
sevastos / aws-multipartUpload.js
Last active May 28, 2024 15:02
Example AWS S3 Multipart Upload with aws-sdk for Node.js - Retries to upload failing parts
// Based on Glacier's example: http://docs.aws.amazon.com/AWSJavaScriptSDK/guide/examples.html#Amazon_Glacier__Multi-part_Upload
var fs = require('fs');
var AWS = require('aws-sdk');
AWS.config.loadFromPath('./aws-config.json');
var s3 = new AWS.S3();
// File
var fileName = '5.pdf';
var filePath = './' + fileName;
var fileKey = fileName;
@brandonb927
brandonb927 / gist:9587436
Created March 16, 2014 18:13
Simple JSON database with Node.JS

From: http://run-node.com/littlest-database-that-could/

I've written numerous tiny databases. They don't have much features, but they don't need much features. Usually I'm looking for fast simple key/value stores and Node never disappoints. The point here is, why abstract key value store when JS gives us one for free, as it's most basic component: object.

Will it meet every need? No. But it will meet ALOT of scenarios.

In memory JS object lookups, were talking hundreds of thousands of lookups (you'll easily flood http before the db), and save hundreds of thousands of records in a JSON file written to disk. Not a 200ms r/t to some hosted Redis. Hey, that's fine if that's your thing.

Here's the requirements:

@alojzije
alojzije / connectHTMLelements_SVG.png
Last active May 13, 2024 08:16
Connect two elements / draw a path between two elements with SVG path (using jQuery)
connectHTMLelements_SVG.png
@SebCorbin
SebCorbin / Enregistrer la selection en SVG.jsx
Created April 7, 2015 14:25
Illustrator script - Save selection as SVG
/*
* Export selection to SVG - export_selection_as_SVG
* (Adapted from Layers to SVG 0.1 - export_selection_as_SVG.jsx, by Rhys van der Waerden)
*
* @author SebCorbin
*/
// Variables
var ignoreHidden = true,
svgExportOptions = (function () {
@mailmindlin
mailmindlin / proxy-polyfill.js
Last active August 25, 2017 16:45
Proxy Polyfill for major webbrowsers
/**
* Partial polyfill for Proxy. For details, see https://gist.github.com/mailmindlin/640e9d707ae3bd666d70
*/
function Proxy (target, handler, revocable) {
var self = this;//because life
//override Object.prototype properties
Object.defineProperty(this, '__lookupGetter__', {value: target.__lookupSetter__.bind(target)});
Object.defineProperty(this, '__lookupSetter__', {value: target.__lookupSetter__.bind(target)});
Object.defineProperty(this, '__defineGetter__', {value: target.__defineGetter__.bind(target)});
Object.defineProperty(this, '__defineSetter__', {value: target.__defineSetter__.bind(target)});