Skip to content

Instantly share code, notes, and snippets.

View chrismo's full-sized avatar

chrismo chrismo

View GitHub Profile
@chrismo
chrismo / install_imagick_amzn2.sh
Last active October 12, 2021 14:52 — forked from sshymko/install_pecl_imagick_amzn2.sh
Install latest ImageMagick 7.x and imagick PHP extension from PECL on Amazon Linux 2
#!/bin/sh
# Uninstall ImageMagic library and imagick PHP extension using it (installed previously)
yum remove -y php-pecl-imagick ImageMagick
# Install libraries for JPG, PNG, GIF, WebP, and TIFF image formats
yum install -y libpng-devel libjpeg-devel openjpeg2-devel libtiff-devel libwebp-devel giflib-devel
# Install latest ImageMagick library compiled from downloaded sources
yum install -y tar gzip gcc make
Fetching gem metadata from https://rubygems.org/........
Fetching version metadata from https://rubygems.org/.
Starting resolution (2016-10-06 10:14:12 -0500)
Resolving dependencies...Creating possibility state for fog (= 1.38.0) (1 remaining)
Attempting to activate fog (1.38.0)
Activated fog at fog (1.38.0)
Requiring nested dependencies (fog-core (~> 1.32), fog-json, fog-xml (~> 0.1.1), ipaddress (~> 0.5), fog-aliyun (>= 0.1.0), fog-atmos, fog-aws (>= 0.6.0), fog-brightbox (~> 0.4), fog-cloudatcost (~> 0.1.0), fog-dynect (~> 0.0.2), fog-ecloud (~> 0.1), fog-google (<= 0.1.0), fog-local, fog-openstack, fog-powerdns (>= 0.1.1), fog-profitbricks, fog-rackspace, fog-radosgw (>= 0.0.2), fog-riakcs, fog-sakuracloud (>= 0.0.4), fog-serverlove, fog-softlayer, fog-storm_on_demand, fog-terremark, fog-vmfusion, fog-voxel, fog-vsphere (>= 0.4.0), fog-xenserver)
Creating possibility state for fog-core (~> 1.32) (14 remaining)
Attempting to activate fog-core (1.43.0)
Activated fog-core at fog-core (1.43.0)
=> bundle outdated
Fetching source index from file:/Users/chrismo/dev/bundler-cases/out/repo/
Resolving dependencies...
Outdated gems included in the bundle:
* bar (newest 1.1.0, installed 1.0.0) in group "default"
* foo (newest 2.0.0, installed 1.0.0) in group "default"
* qux (newest 1.0.1, installed 1.0.0) in group "default"
=> bundle outdated --major
@chrismo
chrismo / .gitignore
Last active January 25, 2016 15:53
Answer to creating multiple has_many records
.bundle
module Car
def vroom
'<car noise>'
end
end
module Boat
def vroom
'<boat noise>'
end
(fn [x coll]
(keep #(if (= (count %) x) % nil)
(map #(map last %)
(vals
(group-by
#(quot (first %) x)
(map-indexed #(vector % %2) coll)))))
)
@chrismo
chrismo / gist:809e901313061c0358a5
Created February 19, 2015 16:35
4clojure #33
(fn [coll x]
(apply concat
(map
(fn [item]
(map
(fn [_] identity item)
(range x)))
coll)))
@chrismo
chrismo / bundle editor.sh
Last active December 12, 2022 02:13
Sequel Pro Format Sql Bundle
ruby formatsql.rb "$(cat)"
Coloured fox fur production, HOPEDALE, Labrador, 1834-1842
#Source: C. Elton (1942) "Voles, Mice and Lemmings", Oxford Univ. Press
#Table 17, p.265--266
29
22
2
16
12
35
8