Skip to content

Instantly share code, notes, and snippets.

View amnonkhen's full-sized avatar

Amnon Khen amnonkhen

View GitHub Profile
@nigelkerr
nigelkerr / hocr.js
Created November 6, 2016 19:44
js to include in a hocr file to make it easier to see the document regions recognized
$( document ).ready(function() {
var bbox_re = /bbox (\d+) (\d+) (\d+) (\d+)/i;
var posr = function(i) {
var t = $(this).attr('title');
var result = t.match(bbox_re);
if ( result ) {
var top = result[2] / 3;
var left = result[1] / 3;
@gre
gre / README.md
Last active January 14, 2019 22:41
Standalone minimal version of Google Photos Albums list in order for you to share photos with family and with link to multiple shared google photos albums

DWTFYW

Disclaimer:

  • no warranty this will work for you!
  • I'm not responsible of how you use this!
  • READ, VERIFY and TEST the CODE before using!
@ThomasR
ThomasR / PowerShell.xml
Created March 21, 2016 20:23
Syntax Highlighting for PowerShell scripts in IntelliJ IDEA
<filetype binary="false" description="PowerShell" name="PowerShell">
<highlighting>
<options>
<option name="LINE_COMMENT" value="#" />
<option name="COMMENT_START" value="&lt;#" />
<option name="COMMENT_END" value="#&gt;" />
<option name="HEX_PREFIX" value="" />
<option name="NUM_POSTFIXES" value="" />
<option name="HAS_BRACES" value="true" />
<option name="HAS_BRACKETS" value="true" />
@andresgutgon
andresgutgon / dosbatch.sublime-build
Created October 29, 2012 15:12 — forked from mmuell/dosbatch.sublime-build
Batch File Running for Sublime Text 2
{
"cmd": ["$file"],
"working_dir": "$file_path",
"selector": "source.dosbatch"
}
@jordansissel
jordansissel / foo.md
Last active February 6, 2021 22:08
logstash message format

logstash json format

{
  "message"    => "hello world",
  "@version"   => "1",
  "@timestamp" => "2014-04-22T23:03:14.111Z",
  "type"       => "stdin",
  "host"       => "hello.local"
}
@itzg
itzg / 0_AddingPersistentVirtualDiskToBoot2Docker.md
Last active February 22, 2021 01:21
Manually adding persistent storage to a VirtualBox VM of boot2docker

These instructions build on those provided here and here.

Before doing the following, create a new virtual disk and attach it to your VM. The size of the virtual disk just depends on what you intend to use/run and how many containers you intend to run. The default, 8 GB, is probably more than enough and is reasonable to use if in doubt since the default mode dynamically allocates the drive as needed.

Boot the VM and run just

fdisk -l

To see the disk device name(s) and their size. In this case it's the /dev/sda shown here that has 8 GB capacity:

@sio
sio / Makefile
Last active January 27, 2022 21:21
Files used in Makefile.venv demo (https://asciinema.org/a/279646)
hello: venv
$(VENV)/python hello.py
include Makefile.venv
Makefile.venv:
curl \
-o Makefile.fetched \
-L "https://github.com/sio/Makefile.venv/raw/v2019.11.06/Makefile.venv"
echo "d32b54ae7cb0e99ec75cff9c4ef78c7050bc0c351f834464674fe4aa328ca370 *Makefile.fetched" \
| sha256sum --check - \
@simonw
simonw / gist:7000493
Created October 15, 2013 23:53
How to use custom Python JSON serializers and deserializers to automatically roundtrip complex types.
import json, datetime
class RoundTripEncoder(json.JSONEncoder):
DATE_FORMAT = "%Y-%m-%d"
TIME_FORMAT = "%H:%M:%S"
def default(self, obj):
if isinstance(obj, datetime.datetime):
return {
"_type": "datetime",
"value": obj.strftime("%s %s" % (
@caroso1222
caroso1222 / dom.service.ts
Last active August 18, 2023 13:34
Service to dynamically append Angular components to the body
import {
Injectable,
Injector,
ComponentFactoryResolver,
EmbeddedViewRef,
ApplicationRef
} from '@angular/core';
@Injectable()
export class DomService {
@carlspring
carlspring / gist:6762356
Last active September 27, 2023 04:02
TeamCity REST API Commands