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.
| #!/usr/bin/pl -q -t einstein -s | |
| einstein :- | |
| /* | |
| условия 0, 1 и 8 можно упостить до: | |
| Houses = [[norwegian,_,_,_,_],_,[_,_,_,milk,_],_,_] | |
| тогда не нужен предикат nth1, но хотелось быть как можно ближе к оригиналу | |
| */ | |
| /* 0. Всего 5 домов */ |
| ActiveAdmin::Dashboards.build do | |
| # Add this section in your dashboard... | |
| section "Background Jobs" do | |
| now = Time.now.getgm | |
| ul do | |
| li do | |
| jobs = Delayed::Job.where('failed_at is not null').count(:id) | |
| link_to "#{jobs} failing jobs", admin_jobs_path(q: {failed_at_is_not_null: true}), style: 'color: red' | |
| end |
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.
by Jonathan Rochkind, http://bibwild.wordpress.com
Capistrano automates pushing out a new version of your application to a deployment location.
I've been writing and deploying Rails apps for a while, but I avoided using Capistrano until recently. I've got a pretty simple one-host deployment, and even though everyone said Capistrano was great, every time I tried to get started I just got snowed under not being able to figure out exactly what I wanted to do, and figured I wasn't having that much trouble doing it "manually".
| #!/usr/bin/env sh | |
| ## | |
| # This is script with usefull tips taken from: | |
| # https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
| # | |
| # install it: | |
| # curl -sL https://raw.github.com/gist/2108403/hack.sh | sh | |
| # |
| import java.awt.Color; | |
| import java.awt.Point; | |
| import java.awt.Rectangle; | |
| import java.awt.image.BufferedImage; | |
| import java.io.File; | |
| import java.io.IOException; | |
| import java.util.ArrayList; | |
| import javax.imageio.ImageIO; | |
| import org.runedream.api.methods.Environment; | |
| import org.runedream.api.methods.Game; |
| module Main where | |
| import qualified Random | |
| main :: IO () | |
| main = do | |
| a <- randInt 0 100 | |
| putStrLn $ show a | |
| -- generate random number between [lo, hi] |
| # Find tutorial; | |
| # http://www.grymoire.com/Unix/Find.html | |
| # find files modified less than 5 days ago | |
| $ find . -type f -mtime -5 -print | xargs ls -l | |
| # find files (with spaces in name) modified less than 5 days ago | |
| $ find . -type f -mtime -5 -print0 | xargs -0 ls -l | |
| # find & remove directories older than 200 days |
| randomChar :: (RandomGen g) => State g Char | |
| randomChar = state $ randomR ('a','z') | |
| randomStringWithLength :: (RandomGen g) => Int -> State g String | |
| randomStringWithLength i = replicateM i randomChar | |
| randomString :: (RandomGen g) => State g String | |
| randomString = state $ \g -> | |
| let (charsToGen, g') = randomR (1,10) g | |
| in runState (randomStringWithLength charsToGen) g' |
| #!/bin/bash | |
| if [ $# -ne 1 ]; then | |
| echo "Usage: ${0} directory" | |
| exit 1 | |
| fi | |
| if [ -d ${1} ]; then | |
| DIR_NAME=$(basename ${1}) |