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
| function copyFbRecord(oldRef, newRef) { | |
| oldRef.once('value', function(snap) { | |
| newRef.set( snap.value(), function(error) { | |
| if( error && typeof(console) !== 'undefined' && console.error ) { console.error(error); } | |
| }); | |
| }); | |
| } |
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
| # unregister broken GHC packages. Run this a few times to resolve dependency rot in installed packages. | |
| # ghc-pkg-clean -f cabal/dev/packages*.conf also works. | |
| function ghc-pkg-clean() { | |
| for p in `ghc-pkg check $* 2>&1 | grep problems | awk '{print $6}' | sed -e 's/:$//'` | |
| do | |
| echo unregistering $p; ghc-pkg $* unregister $p | |
| done | |
| } | |
| # remove all installed GHC/cabal packages, leaving ~/.cabal binaries and docs in place. |
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
| var C_TYPE = 'Type', | |
| C_TITLE = 'Title', | |
| C_ID = 'ID', | |
| C_URL = 'URL', | |
| C_MIME_TYPE = 'file type', | |
| C_ELEMENTS = 'elements in document'; | |
| var HEADERS = [C_TYPE, C_TITLE, C_ID, C_URL, C_MIME_TYPE, C_ELEMENTS]; | |
| function onOpen(){ |
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
| import re | |
| import terminatorlib.plugin as plugin | |
| import subprocess | |
| # Every plugin you want Terminator to load *must* be listed in 'AVAILABLE' | |
| AVAILABLE = ['FileURLHandler'] | |
| class FileURLHandler(plugin.URLHandler): | |
| capabilities = ['url_handler'] | |
| handler_name = 'file_path' |
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
| -- Good | |
| import Database.Persist.Sql | |
| toSqlKey 1 :: UserId | |
| -- Bad | |
| Prelude.read "UserKey {unUserKey = SqlBackendKey {unSqlBackendKey = 1}}" :: UserId |
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
| {-# LANGUAGE ScopedTypeVariables #-} | |
| import Reflex.Dom | |
| import GHCJS.DOM.CanvasRenderingContext2D (putImageData, setFillStyle, fillRect) | |
| import GHCJS.DOM.HTMLCanvasElement (getContext) | |
| import GHCJS.DOM.ImageData (newImageData') | |
| import Control.Monad.IO.Class (liftIO) | |
| import GHCJS.DOM.Types (CanvasStyle(..), CanvasRenderingContext2D(..), toJSString, castToHTMLCanvasElement) | |
| import GHCJS.Marshal (toJSVal) | |
| import Data.Time (getCurrentTime) |
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
| sublime3 and ghcid setup for quick haskell coding feedback | |
| tested on sublime 3 | |
| (you can omit the SublimeOnSaveBuild steps, as the result is not | |
| completely reliable anyways. i still find it useful, though.) | |
| steps: | |
| - install https://github.com/lspitzner/SublimeOnSaveBuild | |
| (original from alexnj; in his/her version the build-window gets closed |
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
| :set prompt "> " | |
| :set -isrc | |
| :load Main |
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
| {-# LANGUAGE RankNTypes #-} | |
| {-# LANGUAGE ScopedTypeVariables #-} | |
| {-# LANGUAGE OverloadedStrings #-} | |
| module Run ( | |
| runner | |
| ) where | |
| import Control.Monad.Reader (ReaderT, runReaderT) | |
| import Data.Foldable (traverse_) |
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
| #!/usr/bin/env bash | |
| # | |
| # Backup selected directories to a Backblaze B2 bucket | |
| # | |
| # Example daily cron: | |
| # @daily /usr/local/bin/b2backup >/dev/null | |
| # | |
| # Account creds | |
| id=xxxxxxxxxx |