Skip to content

Instantly share code, notes, and snippets.

View darthdeus's full-sized avatar

Jakub Arnold darthdeus

View GitHub Profile
takeN :: Int -> [a] -> IO [a]
takeN n xs = sequence $ map (\_ -> sample xs) (replicate n 1)
takeN n xs = replicateM n (sample xs)
{{"aaa", "abaddon", "abadon", "abanico", "abari", "abarth", "abba",
"abbey", "abbu", "abby", "abc", "abercrombie", "abraham", "abraka",
"absolvenske", "absolventske", "aby", "acacia", "acccacia",
"accessoriez", "acdc", "acerbis", "aci", "acres", "acs", "act",
"action", "actions", "active", "acyklisticke", "aceske", "acr",
"adaidas", "adam", "adamem", "adamis", "add", "addidas", "addodas",
"adelai", "adelaide", "adelaine", "adele", "adeleide", "adeleine",
"adelka", "adento", "adidaas", "adidas", "adidog", "adio", "adler",
"adom", "adra", "adrenalin", "adresa", "adresy", "adriana",
"adrspach", "adsidas", "advento", "adventure", "aero", "aerobi",
@darthdeus
darthdeus / rails_resources.md
Created May 8, 2014 17:25 — forked from jookyboi/rails_resources.md
Rails-related Gems and guides to accelerate your web project.

Gems

  • Bundler - Bundler maintains a consistent environment for ruby applications. It tracks an application's code and the rubygems it needs to run, so that an application will always have the exact gems (and versions) that it needs to run.
  • rabl - General ruby templating with json, bson, xml, plist and msgpack support
  • Thin - Very fast and lightweight Ruby web server
  • Unicorn - Unicorn is an HTTP server for Rack applications designed to only serve fast clients on low-latency, high-bandwidth connections and take advantage of features in Unix/Unix-like kernels.
  • SimpleCov - SimpleCov is a code coverage analysis tool for Ruby 1.9.
  • Zeus - Zeus preloads your Rails app so that your normal development tasks such as console, server, generate, and specs/tests take less than one second.
  • [factory_girl](h
@darthdeus
darthdeus / javascript_resources.md
Created May 8, 2014 17:25 — forked from jookyboi/javascript_resources.md
Here are a set of libraries, plugins and guides which may be useful to your Javascript coding.

Libraries

  • jQuery - The de-facto library for the modern age. It makes things like HTML document traversal and manipulation, event handling, animation, and Ajax much simpler with an easy-to-use API that works across a multitude of browsers.
  • Backbone - Backbone.js gives structure to web applications by providing models with key-value binding and custom events, collections with a rich API of enumerable functions, views with declarative event handling, and connects it all to your existing API over a RESTful JSON interface.
  • AngularJS - Conventions based MVC framework for HTML5 apps.
  • Underscore - Underscore is a utility-belt library for JavaScript that provides a lot of the functional programming support that you would expect in Prototype.js (or Ruby), but without extending any of the built-in JavaScript objects.
  • lawnchair - Key/value store adapter for indexdb, localStorage
$ cabal install yesod | head
Resolving dependencies...
In order, the following would be installed:
SHA-1.6.4 (new package)
ansi-terminal-0.6.1.1 (new package)
asn1-types-0.2.3 (new package)
base16-bytestring-0.1.1.6 (new package)
base64-bytestring-1.0.0.1 (new package)
blaze-builder-0.3.3.2 (new package)
blaze-markup-0.6.1.0 (new package)
$ ghc-pkg check
Warning: haddock-interfaces: /Users/darth/.cabal/share/doc/x86_64-osx-ghc-7.8.2/http-conduit-2.1.2/html/http-conduit.haddock doesn't exist or isn't a file
Warning: haddock-html: /Users/darth/.cabal/share/doc/x86_64-osx-ghc-7.8.2/http-conduit-2.1.2/html doesn't exist or isn't a directory
Warning: haddock-interfaces: /Users/darth/.cabal/share/doc/x86_64-osx-ghc-7.8.2/http-client-tls-0.2.1.1/html/http-client-tls.haddock doesn't exist or isn't a file
Warning: haddock-html: /Users/darth/.cabal/share/doc/x86_64-osx-ghc-7.8.2/http-client-tls-0.2.1.1/html doesn't exist or isn't a directory
Warning: haddock-interfaces: /Users/darth/.cabal/share/doc/x86_64-osx-ghc-7.8.2/connection-0.2.1/html/connection.haddock doesn't exist or isn't a file
Warning: haddock-html: /Users/darth/.cabal/share/doc/x86_64-osx-ghc-7.8.2/connection-0.2.1/html doesn't exist or isn't a directory
Warning: haddock-interfaces: /Users/darth/.cabal/share/doc/x86_64-osx-ghc-7.8.2/tls-1.2.7/html/tls.haddock doesn't exist or isn't a file
runDevDB action =
withPostgresqlPool connString 2 $ \pool ->
flip runSqlPersistMPool pool $ do
runMigration migrateAll
action
$ ./dist/build/spec/spec master@fcc3b46
cabal-install version 1.20.0.2
using version 1.20.0.0 of the Cabal library
ghc-mod was built with Cabal version 1.18.1.3
The Glorious Glasgow Haskell Compilation System, version 7.8.2
Root directory: /Users/darth/projects/ghc-mod
Current directory: /Users/darth/projects/ghc-mod
Cabal file: /Users/darth/projects/ghc-mod/ghc-mod.cabal
GHC options: -global-package-db -no-user-package-db -package-db /Users/darth/projects/ghc-mod/.cabal-sandbox/x86_64-osx-ghc-7.8.2-packages.conf.d -XHaskell2010 -optP-include -optP/Users/darth/projects/ghc-mod/dist/build/autogen/cabal_macros.h
Include directories: /Users/darth/projects/ghc-mod /Users/darth/projects/ghc-mod/dist/build /Users/darth/projects/ghc-mod/dist/build/autogen /Users/darth/projects/ghc-mod/src /Users/darth/projects/ghc-mod/test
~/projects/ghc-mod
$ ghc-pkg list -v --global --user --package-db .cabal-sandbox/x86_64-osx-ghc-7.8.2-packages.conf.d
Timestamp 2014-05-24 12:36:04 UTC for .cabal-sandbox/x86_64-osx-ghc-7.8.2-packages.conf.d/package.cache
Timestamp 2014-05-24 12:36:04 UTC for .cabal-sandbox/x86_64-osx-ghc-7.8.2-packages.conf.d (same as cache)
using cache: .cabal-sandbox/x86_64-osx-ghc-7.8.2-packages.conf.d/package.cache
Timestamp 2014-05-24 11:50:25 UTC for /Users/darth/.ghc/x86_64-darwin-7.8.2/package.conf.d/package.cache
Timestamp 2014-05-24 11:50:25 UTC for /Users/darth/.ghc/x86_64-darwin-7.8.2/package.conf.d (same as cache)
using cache: /Users/darth/.ghc/x86_64-darwin-7.8.2/package.conf.d/package.cache
Timestamp 2014-05-24 01:10:18 UTC for /usr/local/Cellar/ghc/7.8.2_2/lib/ghc-7.8.2/package.conf.d/package.cache
Timestamp 2014-05-24 01:10:18 UTC for /usr/local/Cellar/ghc/7.8.2_2/lib/ghc-7.8.2/package.conf.d (same as cache)
$ cabal build -v3 master@fcc3b46
Skipping add-source deps check...
Using a sandbox located at /Users/darth/projects/ghc-mod/.cabal-sandbox
The sandbox was created after the package was already configured.
Re-configuring with most recently used options. If this fails, please run
configure manually.
Using a sandbox located at /Users/darth/projects/ghc-mod/.cabal-sandbox
Searching for ghc in path.
Found ghc at /usr/local/bin/ghc
("/usr/local/bin/ghc",["--numeric-version"])