Skip to content

Instantly share code, notes, and snippets.

View sliminality's full-sized avatar

Slim sliminality

View GitHub Profile
@sliminality
sliminality / cmReformat.js
Created November 18, 2015 20:37
Formatting source with CodeMirror
// Editor initialization
var area = $('textarea.text-editor'); // or whatever yours is called
editor = CodeMirror.fromTextArea(area.get(0), {
mode: {name: "xml", htmlMode: true}, // enables syntax highlighting, need to download the relevant modules
lineNumbers: true,
lineWrapping: true,
tabSize: 2
});
@sliminality
sliminality / README.md
Last active August 21, 2023 22:22
Verbatim macro to emphasize the first letter of each word in a selection

Installation

Navigate to Verbatim Settings -> Admin -> Templates Folder, right click Debate.dotm, and choose Open (NOT “New”).

Microsoft Word should open. In the ribbon, navigate to Developer -> Visual Basic; a new window should pop up.

In the sidebar: Verbatim(Debate) -> Modules -> Formatting and double click on Formatting The first lines of the main window should say:

Option Explicit
(define-struct circle [radius color])
; A Circle is a structure: (make-circle Number String)
(define circ1 (make-circle 4 "blue"))
(define circ2 (make-circle 2 "red"))
; -----------------------------------------------------
(define-struct square [side color])
; A Square is a structure: (make-square Number String)
@sliminality
sliminality / frontend-resources.md
Last active November 23, 2016 15:33
resources for preparing for front-end development interviews

Front-end Interview Preparation

Generally useful

  • JSBin (jsbin.com) -- really helpful tool for messing around in HTML/CSS/JS. Make sure to log in with your GitHub account (and make a GitHub if you don't already have one) so that all your work is saved

  • The Code Player (http://thecodeplayer.com/) -- nifty site with "screencast"-style animations to watch how web apps and effects are built

  • Mozilla Developer Network (MDN) documentation (https://developer.mozilla.org/en-US/docs/Web) -- if you need to reference anything related to web technology, like looking up JavaScript functions or CSS properties, use this website. You should never ever ever ever use W3Schools.org -- they are bad and wrong and always use MDN instead

HTML

@sliminality
sliminality / codrops_query.js
Created May 11, 2016 20:56
queries codrops css reference using jam api
const request = require('request');
const url = "http://tympanus.net/codrops/css_reference/background-image";
const json_data = {
"title": "title",
"syntax": [{
"elem": ".ct-cssref-info pre:first-of-type",
"value": "text"
}],
"info": [{
"elem": ".ct-cssref-info ul li",
@sliminality
sliminality / arrayChunker.js
Created August 3, 2016 20:07
chunk an array of numbers
const chunker = (partial, current) => {
const end = partial.length - 1;
if (end >= 0 && current === partial[end][0]) {
return [
...partial.slice(0, end),
[...partial[end], current]
];
}
@sliminality
sliminality / Default (OSX).sublime-keymap
Last active April 6, 2017 01:18
Github-flavored Markdown with TeX syntax embedded
// LaTeX dollar sign encapsulation
{ "keys": ["$"], "command": "insert_snippet", "args": { "contents": "\\$${0:$SELECTION}\\$" }, "context": [
{ "key": "selector", "operator": "not_equal", "operand": "markup.raw", "match_all": true },
{ "key": "following_text", "operator": "not_regex_contains", "operand": "^(?:\t| |\\)|]|\\}|$)", "match_all": true },
{ "key": "preceding_text", "operator": "not_regex_contains", "operand": "['a-zA-Z0-9$]$", "match_all": true },
{ "key": "selector", "operator": "equal", "operand": "text.html.markdown.gfm, text.html.markdown" },
{ "key": "selector", "operator": "not_equal", "operand": "string.other.math" },
{ "key": "setting.auto_match_enabled", "operand": true, "operator": "equal" },
{"key": "eol_selector", "match_all": true, "operand": "comment.line.percentage", "operator": "not_equal"},
{"key": "selection_empty", "match_all": true, "operand": false, "operator": "equal"},
@sliminality
sliminality / map-filter-examples.rkt
Created October 17, 2016 04:34
map and filter examples from EECS 111 recitation
(define-struct person (name age))
(define CONTACTS (list (make-person "Sarah" 20)
(make-person "Ian" 99)
(make-person "Bob" 14)
(make-person "Joe" 15)))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; map example
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@sliminality
sliminality / conditionals.rkt
Created October 24, 2016 02:27
111FA16 Quiz 1 Review Session
; Conditionals
; (if <this> ; boolean
; <then-this>
; <else-this>)
; (if (and (> x a)
; (< x b))
; "x in range"
@sliminality
sliminality / how-cons-works.rkt
Last active October 31, 2016 01:33
recursion recitation notes
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; NOTE: This particular week's examples are much easier to read in DrRacket,
; since they make heavy use of the comment box. Would recommend downloading
; the .rkt files off the website and viewing them on your own computer.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;
; how cons works
;;;;;;;;;;;;;;;;;;;;;;;;;;