Skip to content

Instantly share code, notes, and snippets.

@Decoherence
Decoherence / Spock_PostgrSQL_Users.hs
Last active August 29, 2015 14:19
Haskell: Testing Spock web server using PostgreSQL backend and the 'users' library for user management & session handling.
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE DeriveGeneric #-}
module Main where
import Database.PostgreSQL.Simple
import Data.Aeson hiding (json)
import Data.Monoid
import Data.Text (pack)
import GHC.Generics
@Decoherence
Decoherence / TypeSafeRocket.hs
Last active August 29, 2015 14:19
Example: Type-safe rocket launch using the Either monad transformer.
module Main where
import Control.Monad.Trans
import Control.Monad.Trans.Either
import Safe
data Sensor = Temp
| Fuel
| Pressure
@526avijitgupta
526avijitgupta / spacemacs-cheatsheet.md
Last active August 29, 2023 12:31
Spacemacs cheatsheet

emacs --daemon to run in the background. emacsclient.emacs24 <filename/dirname> to open in terminal

NOTE: "M-m and SPC can be used interchangeably".

  • Undo - C-/
  • Redo - C-?
  • Change case: 1. Camel Case : M-c 2. Upper Case : M-u
  1. Lower Case : M-l
@cies
cies / .spacemacs
Created September 13, 2015 12:44
My .spacemacs when trying to get a full features Haskell setup that is stack-aware
;; -*- mode: emacs-lisp -*-
;; This file is loaded by Spacemacs at startup.
;; It must be stored in your home directory.
(defun dotspacemacs/layers ()
"Configuration Layers declaration."
(setq-default
;; List of additional paths where to look for configuration layers.
;; Paths must have a trailing slash (i.e. `~/.mycontribs/')
dotspacemacs-configuration-layer-path '()
@brock
brock / psql-with-gzip-cheatsheet.sh
Last active March 6, 2025 00:21
Exporting and Importing Postgres Databases using gzip
# This is just a cheat sheet:
# On production
sudo -u postgres pg_dump database | gzip -9 > database.sql.gz
# On local
scp -C production:~/database.sql.gz
dropdb database && createdb database
gunzip < database.sql.gz | psql database
# Android SDK setup
## Install Java
```bash
sudo apt-get update
sudo dpkg --add-architecture i386
sudo apt-get install libbz2-1.0:i386
sudo apt-get install libc6:i386 libncurses5:i386 libstdc++6:i386 lib32z1
sudo apt-get install openjdk-8-jdk openjdk-8-jre
@chrismccord
chrismccord / upgrade.md
Last active April 7, 2023 12:03
Phoenix 1.2.x to 1.3.0 Upgrade Instructions

If you want a run-down of the 1.3 changes and the design decisions behidn those changes, check out the LonestarElixir Phoenix 1.3 keynote: https://www.youtube.com/watch?v=tMO28ar0lW8

To use the new phx.new project generator, you can install the archive with the following command:

$ mix archive.install https://github.com/phoenixframework/archives/raw/master/phx_new.ez

Bump your phoenix dep

Phoenix v1.3.0 is a backwards compatible release with v1.2.x. To upgrade your existing 1.2.x project, simply bump your phoenix dependency in mix.exs:

@branflake2267
branflake2267 / flutter-gource.sh
Last active March 25, 2020 15:24
Flutter gource visualization commands. Visualizing the commit history with gource.
#!/bin/sh
# gource
# https://gource.io/
# flutter
# https://github.com/flutter
# 1. clone or git pull all repos
@Ch4s3
Ch4s3 / install_and_deploy_elixir_phoenix_on_centos7_rhel.md
Last active April 30, 2022 19:44
Instructions for installing Elixir 1.4, Phoenix 1.2.x, and Erlang 19+ on Centos7/RHEL and deploy with edeliver and distillery. Webpack + React + Yarn for JS

Set the environment variables

Install nano(or not if you intend to use vi)

yum install -y nano

Open ~/.profile with nano ~/.profile and add the following:

@joshschmelzle
joshschmelzle / remap-capslock-to-control-win10.md
Last active April 29, 2025 18:54
Remap Caps Lock to Control on Windows 10

Ways to remap caps lock to control on Windows 10

These methods in this gist worked for me on my U.S.-based keyboard layouts. I am unsure about other layouts. If you have problems, revert your changes; delete the registry key you created (and reboot).

Update: you should probably scroll down to approach 4 where I suggest using Microsoft PowerToys Keyboard Manager.

Approach 1. Manually through regedit

Navigate to and create a new binary value in HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout named Scancode Map.