This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ./config/database.yml is standard except specifying reaping_frequency | |
# adapter: postgresql | |
# database: all_products | |
# username: postgres | |
# host: localhost | |
# pool: 2 | |
# reaping_frequency: 30 | |
require 'rubygems' | |
require 'bundler/setup' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Documentation: https://github.com/Homebrew/homebrew/blob/master/share/doc/homebrew/Formula-Cookbook.md | |
# http://www.rubydoc.info/github/Homebrew/homebrew/master/frames | |
# PLEASE REMOVE ALL GENERATED COMMENTS BEFORE SUBMITTING YOUR PULL REQUEST! | |
class Pdfsandwich < Formula | |
desc "A tool to make \"sandwich\" OCR pdf files" | |
homepage "http://www.tobias-elze.de/pdfsandwich/" | |
url "http://downloads.sourceforge.net/project/pdfsandwich/pdfsandwich%200.1.4/pdfsandwich-0.1.4.tar.bz2" | |
version "0.1.4" | |
sha256 "8b82f3ae08000c5cae1ff5a0f6537b0b563befef928e5198255b743a46714af3" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
thebes $ brew install pdfsandwich | |
==> Downloading http://downloads.sourceforge.net/project/pdfsandwich/pdfsandwich%200.1.4/pdfsandwich-0.1.4.tar.bz2 | |
Already downloaded: /Library/Caches/Homebrew/pdfsandwich-0.1.4.tar.bz2 | |
==> ./configure --prefix=/usr/local/Cellar/pdfsandwich/0.1.4 | |
==> make install | |
mkdir -m 755 -p /usr/local/Cellar/pdfsandwich/0.1.4/bin /usr/local/Cellar/pdfsandwich/0.1.4/share/doc/pdfsandwich /usr/local/Cellar/pdfsandwich/0.1.4/share/man/man1 | |
install -s pdfsandwich /usr/local/Cellar/pdfsandwich/0.1.4/bin | |
install: pdfsandwich: No such file or directory | |
make: *** [install] Error 71 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns om-tutorial.core | |
(:require [goog.dom :as gdom] | |
[om.next :as om :refer-macros [defui]] | |
[om.dom :as dom])) | |
(enable-console-print!) | |
(defmulti read om/dispatch) | |
; this is a better version of my read function, where I should be able to supply a key by which to filter like parent-id e.g. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns foo-cart.core | |
(:require [goog.dom :as gdom] | |
[om.next :as om :refer-macros [defui]] | |
[om.dom :as dom] | |
[cljs.pprint :as pp])) | |
(enable-console-print!) | |
(defmulti read om/dispatch) | |
(defmulti mutate om/dispatch) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'concurrent' | |
require 'benchmark' | |
def process_sheets(sheets) | |
all_dependencies = Concurrent::Array.new | |
sheets.each_pair do |name, rows| | |
rows.each do |val| | |
all_dependencies.push(Concurrent::Future.execute {val*2}) | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#file_path = some excelx file with 6 sheets..... | |
## WITH DUP | |
roo = Roo::Spreadsheet.open file_path | |
jobs = Concurrent::Array.new | |
roo.each_with_pagename do |name, sheet| | |
local_sheet = sheet.dup |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Roo::Base | |
def each_sheet_concurrently(&block) | |
jobs = Concurrent::Array.new | |
self.sheets.each do |name| | |
jobs << Concurrent.future { | |
block.call(self.sheet(name)) | |
} | |
end | |
Concurrent.zip(*jobs).value |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'concurrent' | |
require 'concurrent-edge' | |
# require 'benchmark' | |
# require 'pry' | |
# rails... | |
#require './config/environment' | |
class Roo::Base | |
def each_sheet_concurrently(&block) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT value, id, similarity | |
FROM other_table | |
CROSS JOIN LATERAL ( | |
SELECT similarity(master_table.value, other_table.value) as similarity | |
FROM master_table | |
ORDER BY similarity DESC | |
LIMIT 1 | |
) l |