Skip to content

Instantly share code, notes, and snippets.

View johnjcamilleri's full-sized avatar

John J. Camilleri johnjcamilleri

View GitHub Profile
@johnjcamilleri
johnjcamilleri / mmap
Last active October 18, 2021 11:40
macOS man pages
MMAP(2) BSD System Calls Manual MMAP(2)
NAME
mmap -- allocate memory, or map files or devices into memory
LIBRARY
Standard C Library (libc, -lc)
SYNOPSIS
#include <sys/mman.h>
@johnjcamilleri
johnjcamilleri / mkpngs.sh
Last active September 30, 2019 09:59
Convert FontAwesome's SVG icons to PNG
#!/bin/sh
# Convert all FontAwesome SVGs to PNGs
#
# Instructions:
# 1. Download FontAwesome's desktop package & extract
# 2. Save this script to the root folder & make it executable
# 3. (Optional) Choose conversion method below
# 4. Run! (takes a few minutes to get through the whole collection)
@johnjcamilleri
johnjcamilleri / atom-selection-mode.md
Last active April 17, 2019 09:28
Atom selection mode feature

This is a hand-rolled alternative to the plugin https://github.com/jeffgran/atom-selection-mode.

My two major requests which that plugin doesn't support are:

  1. Do not deselect when tabbing
  2. Have an indicator when selection mode is on

My version does both these and is a bit simpler, but also less versatile/general. But it fills my need, and maybe someone else's too.

To get it to work, just paste the bits in the relevant files. Maybe I'll package it into a plugin one day.

john@Maqrut:~/repositories/GF$ time split/run.sh -y
GF repository split script
Usage: run.sh [-d PATH] [-y]
# pristine
Pulling...
Cleaning...
# gf-core
Copying...
@johnjcamilleri
johnjcamilleri / dependencies.sh
Created June 25, 2018 07:24
Produce dependencies graph for Haskell project
#!/bin/sh
# Produce PNG of module dependencies (requires GraphViz `dot` command)
# John J. Camilleri, 2018
# Configurable options
dotfile="_deps.dot"
imgfile="_deps.png"
searchin="src"
@johnjcamilleri
johnjcamilleri / site.hs
Created August 25, 2017 06:58
Hakyll issues
--------------------------------------------------------------------------------
{-# LANGUAGE OverloadedStrings #-}
import Data.Monoid (mappend)
import Hakyll
--------------------------------------------------------------------------------
main :: IO ()
main = hakyll $ do
match "images/*" $ do
This is now a view method. Call TextEditorElement::getHeight instead.
TextEditor.getHeight - <embedded>:5679:18
Object.toggle - /Users/john/.atom/packages/center-line/lib/center-line.coffee:44:25
atom-text-editor.atom.commands.add.center-line:toggle - /Users/john/.atom/packages/center-line/lib/center-line.coffee:11:26
CommandRegistry.handleCommandEvent - <embedded>:18901:35
<unknown> - <embedded>:18639:65
KeymapManager.dispatchCommandEvent - <embedded>:66514:22
This is now a view method. Call TextEditorElement::getHeight instead.
TextEditor.getHeight - <embedded>:5679:18
@johnjcamilleri
johnjcamilleri / activate-hs
Created November 10, 2015 13:38
activate-hs
#!/bin/sh
quiet=no
verbose=no
dryrun=no
list=no
version="" # forgiving user input version
hpVersion="" # like "2014.2.0.0"
@johnjcamilleri
johnjcamilleri / bard.json
Last active August 29, 2015 14:25
Examples of the data structure for the Minsel Etymological Dictionary
{
"lemma" : "bard",
"pos" : "NOUN",
"gender" : "m",
"senses" : [
{
"sense_id" : 1,
"description" : [
"cold, coldness, coolness, chilliness, freezing cold"
],
> quickCheck (property True)
+++ OK, passed 100 tests.
> quickCheck (property False)
*** Failed! Falsifiable (after 1 test):
> quickCheck (unsafePerformIO $ return $ property True)
+++ OK, passed 100 tests.
> quickCheck (unsafePerformIO $ return $ property False)
*** Failed! Falsifiable (after 1 test):