Install ImageMagick for image conversion:
brew install imagemagick
Install tesseract for OCR:
brew install tesseract --all-languages
Or install without --all-languages
and install them manually as needed.
// | |
// Regular Expression for URL validation | |
// | |
// Author: Diego Perini | |
// Created: 2010/12/05 | |
// Updated: 2018/09/12 | |
// License: MIT | |
// | |
// Copyright (c) 2010-2018 Diego Perini (http://www.iport.it) | |
// |
literally always have to look up the meaning of :limit in migrations when it comes to integer values. Here's an overview. Now let's memorise it (oh, this works for MySQL, other databases may work differently): | |
:limit Numeric Type Column Size Max value | |
1 tinyint 1 byte 127 | |
2 smallint 2 bytes 32767 | |
3 mediumint 3 byte 8388607 | |
nil, 4, 11 int(11) 4 byte 2147483647 | |
5..8 bigint 8 byte 9223372036854775807 | |
Note: by default MySQL uses signed integers and Rails has no way (that I know of) to change this behaviour. Subsequently, the max. values noted are for signed integers. |
1password - Password mangager | |
3hub - Amazon s3 file manager | |
Adium - Instant messenger | |
Arq - Amazon s3 backup | |
Air Server - Send your iPhone/iPad screen to your mac screen for demos | |
Alfred - Launch bar app (must have) | |
Base - Sqlite db viewer | |
Caffeine - Keeps computer awake | |
Charles - Web debugging proxy | |
Cornerstone - SVN client |
1password - Password mangager | |
Adium - Instant messenger | |
Arq - Amazon s3 backup | |
Base - Sqlite db viewer | |
Caffeine - Keeps computer awake | |
Charles - Web debugging proxy | |
Cornerstone - SVN client | |
Cyberduck - FTP client | |
Delibar - Delicious bookmarking menu item | |
DiskWave - Monitor hdd space |
/** | |
/** | |
* Changes the sort order of assets in Squiz Matrix | |
* Author: Nicholas Hubbard (http://www.zedsaid.com/blog/change-the-asset-map-sort-order-using-javascript-in-squiz-matrix) | |
* | |
* @param number id ID of the asset to move | |
* @param number parent ID of the parent that the asset is under | |
* @param number new_position New position of asset (0 is first in the sort order) | |
* | |
* @return string |
<?php | |
// First, include the Matrix bootstrap | |
// When ever a user makes any request to a Matrix page, this file is loaded (i.e. in the index.php file) | |
$SYSTEM_ROOT = "/home/websites/squiz_matrix/"; | |
require_once $SYSTEM_ROOT . "core/include/init.inc"; | |
// Now we need to log in | |
// The easiest user to work with is Root User | |
$root_user = $GLOBALS["SQ_SYSTEM"]->am->getSystemAsset("root_user"); |
Install ImageMagick for image conversion:
brew install imagemagick
Install tesseract for OCR:
brew install tesseract --all-languages
Or install without --all-languages
and install them manually as needed.
''' | |
Tests different methods of concatenating files in Python. | |
''' | |
from __future__ import print_function | |
import json,os,shutil,subprocess | |
import util | |
def verify(file,expected): | |
count = 0 |
A slightly updated version of this doc is here on my website.
I visited with PagerDuty yesterday for a little Friday beer and pizza. While there I got started talking about Go. I was asked by Alex, their CEO, why I liked it. Several other people have asked me the same question recently, so I figured it was worth posting.
The first 1/2 of Go's concurrency story. Lightweight, concurrent function execution. You can spawn tons of these if needed and the Go runtime multiplexes them onto the configured number of CPUs/Threads as needed. They start with a super small stack that can grow (and shrink) via dynamic allocation (and freeing). They are as simple as go f(x)
, where f()
is a function.
One of the many things I do for my group at work is to take care of automating as many things as possible. It usually brings me a lot of satisfaction, mostly because I get a kick out of making people's lives easier.
But sometimes, maybe too often, I end up in drawn-out struggles with machines and programs. And sometimes, these struggles bring me to the edge of despair, so much so that I regularly consider living on a computer-less island growing vegetables for a living.
This is the story of how I had to install Pandoc in a CentOS 6 Docker container. But more generally, this is the story of how I think computing is inherently broken, how programmers (myself included) tend to think that their way is the way, how we're ultimately replicating what most of us think is wrong with society, building upon layers and layers of (best-case scenario) obscure and/or weak foundations.
*I would like to extend my gratitude to Google, StackOverflow, GitHub issues but mostly, the people who make the