Skip to content

Instantly share code, notes, and snippets.

@XBigTK13X
XBigTK13X / pdf-extract-images.py
Last active February 12, 2025 16:46
Extracts images from a PDF and attempts to compose any matching image masks.
#! /usr/bin/python3
# This script requires pdfimage (poppler-utils) and convert (imagemagick)
# Raw images will be written to <OUTPUT_DIR>/15-organized
# Attempts at merging masks and images will be output to <OUTPUT_DIR/30-masked>
# A sample of one image using all compose methods will be written to <OUTPUT_DIR>/25-samples
# Rewritten from https://gist.github.com/bendavis78/ed22a974c2b4534305eabb2522956359
@manigandham
manigandham / rich-text-html-editors.md
Last active April 16, 2025 18:28
Rich text / HTML editors and frameworks

Strictly Frameworks

Abstracted Editors

These use separate document structures instead of HTML, some are more modular libraries than full editors

@rusllonrails
rusllonrails / UBUNTU DOCKER FIG ERROR
Created August 14, 2014 12:16
UBUNTU DOCKER FIG ERROR
FIX FOR: Couldn't connect to Docker daemon at http+unix://var/run/docker.sock - is it running?
Change the DOCKER_OPTS in /etc/default/docker to:
DOCKER_OPTS="-H tcp://127.0.0.1:4243 -H unix:///var/run/docker.sock"
Ruslan Khamidullin [1:57 PM] netstat -ant |grep 4243
tcp 0 0 127.0.0.1:4243 0.0.0.0:* LISTEN
Ruslan Khamidullin [1:57 PM] export DOCKER_HOST=tcp://localhost:4243
@peter
peter / gist:9121297
Created February 20, 2014 19:24
Force SSL for Express app on Heroku
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// Hooking up the middleware with the express app
// In app.js
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
var forceSSL = require('../middleware/ssl').force(config.hostname);
if ('production' == app.get('env')) {
app.use(forceSSL);
}
@warappa
warappa / Bootstrap.cs
Last active December 22, 2015 00:19
A possible way of doing event-versioning with NEventStore and a custom Json.Net NEventStore-serializer.
public class EventStorageBootStrap
{
public static void BootStrap()
{
...
var eventStore = Wireup.Init()
...
.UsingNewtonsoftJsonSerialization(new VersionedEventSerializationBinder())
...
.Build();
@jfoshee
jfoshee / ListPickerViewModel.cs
Created March 22, 2013 19:20
Implementation of MonoTouch (Xamarin.iOS) UIPickerViewModel for an IList<T>.
namespace Unplugged
{
public abstract class ListPickerViewModel<TItem> : UIPickerViewModel
{
public TItem SelectedItem { get; private set; }
IList<TItem> _items;
public IList<TItem> Items
{
get { return _items; }
@yetanotherchris
yetanotherchris / gist:4746671
Last active February 14, 2017 21:20
Unique identifiers: Base62
public static string Base62Random()
{
int random = _random.Next();
return Base62ToString(random);
}
private static string Base62ToString(long value)
{
// Divides the number by 64, so how many 64s are in
// 'value'. This number is stored in Y.
@bsatrom
bsatrom / addSpeaker-brief.html
Created June 30, 2011 22:06
Moving from markup-based KnockoutJS bindings to unobtrusive bindings (Before)
<form data-bind="submit: addSpeaker">
<fieldset>
<legend>Speaker Info</legend>
Name: <input type="text" data-bind="value: name" /> <br />
Bio: <textarea data-bind="value: bio"></textarea> <br />
Twitter Handle: <input type="text" data-bind="value: twitterHandle" /> <br />
State: <input type="text" data-bind="value: state" /> <br />
</fieldset>
<fieldset>
<legend>Languages</legend>
@joelnet
joelnet / example.html
Created June 3, 2011 18:03
Unobtrusive Knockout support library for jQuery
Choose a ticket class: <select id="tickets"></select>
<p id="ticketOutput"></p>
<script id="ticketTemplate" type="text/x-jquery-tmpl">
{{if chosenTicket}}
You have chosen <b>${ chosenTicket().name }</b>
($${ chosenTicket().price })
<button data-bind="click: resetTicket">Clear</button>
{{/if}}