Skip to content

Instantly share code, notes, and snippets.

@caiorss
caiorss / .spacemacs
Created February 18, 2017 22:01 — forked from ulyssesdotcodes/.spacemacs
My spacemacs
dotspacemacs-default-font '("Source Code Pro"
:size 18
:weight normal
:width normal
:powerline-scale 1.1)
(server-start)
(setq haskell-default-program "stack ghci")
#!/usr/bin/env zsh
# ----------------------------------------------------------------------
# Send the standard input into a running emacs server, either on the
# kill ring, in a specified register, or in a new buffer. Examples:
# echo -n some text into the kill ring | into-emacs
# echo -n other text into register 1 | into-emacs -r 1
# long_command | into-emacs -b "long command output"
@caiorss
caiorss / haddock-escape.el
Created February 15, 2017 00:14 — forked from 23Skidoo/haddock-escape.el
An Elisp function for escaping special characters in Haddock's @ code blocks
; See http://www.haskell.org/haddock/doc/html/ch03s08.html#idp1371070500
; and http://www.haskell.org/haddock/doc/html/ch03s08.html#idp1371060908
;
; Examples:
; \, /, ', `, ", @, < ===> \\, \/, \', \`, \", \@, \<
; foo `fmap` bar "/a/b" ===> foo \`fmap\` bar \"\/a\/b\"
(defun haddock-escape (start end)
"Escape symbols that have special meaning in Haddock comments."
(interactive "r")
(replace-regexp "\\([^\\\\]?\\)\\(`\\|'\\|\\\"\\|@\\|<\\|/\\|\\\\\\)" "\\1\\\\\\2" nil start end))
@caiorss
caiorss / haddock.hs
Created February 15, 2017 00:11
A haddock cheat sheet because I'm incapable of remembering this shit.
{-|
Module : module documentation
Description : as;ldkjf
Copyright : >implying
License : >implying
Maintainer : lol
Stability : not
Portability : what
Module description here
@caiorss
caiorss / glibc-check.sh
Created February 13, 2017 16:25 — forked from fasterthanlime/glibc-check.sh
Prints the various glibc versions required by an executable
#!/bin/bash
# This scripts lets you check which minimum GLIBC version an executable requires.
# Simply run './glibc-check.sh path/to/your/binary'
#
# You can set `MAX_VER` however low you want, although I (fasterthanlime)
# feel like `2.13` is a good target (For reference, Ubuntu 12.04 has GLIBC 2.15)
MAX_VER=2.13
SCRIPTPATH=$( cd $(dirname $0) ; pwd -P )
@caiorss
caiorss / List of languages that compile to JS.md
Created February 12, 2017 22:15
List of languages that compile to JS
@caiorss
caiorss / C# to F# 2.fs
Created January 21, 2017 05:17 — forked from nagat01/C# to F# 2.fs
My training.Translating C# code to F#.
(*
My training.Translating C# code to F#.
http://www.fincher.org/tips/Languages/csharp.shtml
*)
open System
open System.IO
open System.Net
@caiorss
caiorss / .ctags
Created January 21, 2017 03:58 — forked from tsdeng/.ctags
scala emacs
--langdef=Scala
--langmap=Scala:.scala
--regex-Scala=/^[ \t]*class[ \t]*([a-zA-Z0-9_]+)/class \1/c,classes/
--regex-Scala=/^[ \t]*object[ \t]*([a-zA-Z0-9_]+)/object \1/o,objects/
--regex-scala=/^[ \t]*trait[ \t]*([a-zA-Z0-9_]+)/trait \1/t,traits/
--regex-Scala=/^[ \t]*case[ \t]*class[ \t]*([a-zA-Z0-9_]+)/case class \1/m,case-classes/
--regex-Scala=/^[ \t]*abstract[ \t]*class[ \t]*([a-zA-Z0-9_]+)/abstact class \1/a,abstract-classes/
--regex-Scala=/^[^\*\/]*def[ \t]*([a-zA-Z0-9_]+)[ \t]*.*[:=]/f \1/f,functions/
#--regex-Scala=/^[^\*\/]*val[ \t]*([a-zA-Z0-9_]+)[ \t]*[:=]/\1/V,values/
#--regex-Scala=/^[^\*\/]*var[ \t]*([a-zA-Z0-9_]+)[ \t]*[:=]/\1/v,variables/
@caiorss
caiorss / curl.md
Created January 18, 2017 19:44 — forked from subfuzion/curl.md
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@caiorss
caiorss / SimpleHTTPServer.cs
Created January 13, 2017 03:29 — forked from aksakalli/SimpleHTTPServer.cs
SimpleHTTPServer in C#
// MIT License - Copyright (c) 2016 Can Güney Aksakalli
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net.Sockets;
using System.Net;
using System.IO;
using System.Threading;