Skip to content

Instantly share code, notes, and snippets.

View CarlOlson's full-sized avatar
🗾

Carl Olson CarlOlson

🗾
View GitHub Profile
;; don't use this, going to do a PR with a better solution
;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; Alchemist Helm Help ;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defvar alchemist-helm-candidates nil)
(defvar alchemist-helm-new-candidates nil)
(defvar alchemist-helm-filter-output nil)
(defvar alchemist-helm-timeout 1)
(require 'cl-lib)
(define-minor-mode lambda-mode
"A minor mode to help type lambda terms. Turns abbreviations
of the form \\lx into λx, with x being any letter."
nil " λ" (make-sparse-keymap)
(abbrev-mode (if lambda-mode 1 -1))
(setq save-abbrevs nil))
(define-abbrev-table 'lambda-mode-abbrev-table
;;;;;;;;;;;;;;;;;;;;;;
;;; delete-word.el ;;;
;;;;;;;;;;;;;;;;;;;;;;
(global-set-key (kbd "C-S-d") #'delete-forward-word)
(global-set-key (kbd "C-S-h") #'delete-backward-word)
(defun delete-forward-word (point)
"Deletes forwards by words. Similar to `delete-forward-char'
and `delete-backward-word', but doesn't stop at any punctuation."
defmodule Defs do
defmacro defs({name, _, _}, do: entries)
when length(entries) > 0 do
entries
|> Enum.map(&parse_entry(name, &1))
|> Enum.map(&create_def/1)
|> concat_quoted
end
:- use_module(library(clpfd)).
something(N, N0) :-
N0 #= N // 2.
clpfd_test(L) :-
S #>= 2,
S #=< 10,
bagof(N, something(S, N), L).

Mocha + ES6

Setup

Run the following shell commands:

npm init
npm i --save-dev mocha chai babel-register babel-preset-es2015

Open up package.json and set your test script to the following: mocha --watch --compilers js:babel-core/register

// Example of Server Reflected XSS
// https://www.owasp.org/index.php/Types_of_Cross-Site_Scripting
const express = require('express');
const session = require('express-session');
const app = express();
const port = 3000;
var payload = "<script>\
document.body.innerHTML = '';\
@CarlOlson
CarlOlson / osx-build.org
Created March 28, 2017 15:11
Cedille build instructions for OSX (and maybe linux)

OSX Setup

First install the nix package manager: https://nixos.org/nix/

Then install the dependencies:

nix-env -f "<nixpkgs>" -iA haskellPackages.ghc
nix-env -f "<nixpkgs>" -iA haskellPackages.cabal-install
nix-env -f "<nixpkgs>" -iA haskellPackages.Agda
cabal update
cabal install ieee
(defmacro se--when-windows (&rest body)
(declare (indent 1))
`(when (or (eq system-type 'ms-dos)
(eq system-type 'windows-nt)
(eq system-type 'cygwin))
,@body))
(se--when-windows
(defun se--remove-drive-letter (path)

Forward

This will be the steps to setup my (very opinionated) shell environment. Many things may go wrong (environmental variables, paths, etc), but this could be a great learning opertunity.

Use the man command for help! Man pages are viewed in less, try man less to learn how to navigate them better!

Setup

Install Nix Package Manager