Skip to content

Instantly share code, notes, and snippets.

@kylejohnston
kylejohnston / google search tips
Last active August 29, 2015 14:17
Tips for better Google Searches
Example:
site:nytimes.com ~college "test scores" -SATs 2008…2010
- site: only searches pages of that site
- ~college – will also search related words, such as 'higher education' or 'university'
- "test scores" – searches for the exact phrase, not each of the words separately
- -SATs – excludes this term from the search
- 2008…2010 – shows all results from within the designated range
[Source](https://twitter.com/MaxCRoser/status/556479678299791360/photo/1)
@kylejohnston
kylejohnston / mamp configuration tips
Last active August 29, 2015 14:17
MAMP Configuration Tips
Tags: #reference #mamp #hosting #server
# Fix for MAMP when MySQL is not starting
If you get the “Error: Could not connect to MySQL server!” notice, here’s a fix:
1. Quit MAMP
2. Open the terminal and type: killall -9 mysqld
3. Restart MAMP
[Source](http://twob.net/journal/fix-for-mamp-mysql/)
---
@kylejohnston
kylejohnston / MODULAR SCALES.md
Last active August 4, 2016 04:12
Modular Typographic Scales

MODULAR SCALES

Ratio: 1.414, Aug. Fourth / Dim. Fifth

Size (pt) Line Height
40 1em
56.56 1.414
79.976 1.999
113.086 2.827
159.903 3.998

Goto

Shortcut Action
Command-P Goto Anything - Type part of a file name to open it. Type @ to jump to symbols, # to search within the file, and : to go to a line number.
Command-Shift-P The Command Palette holds infrequently used functionality, like sorting, changing the syntax and changing the indentation settings.
Control-G Goto line

Select Commands

Shortcut Action
@kylejohnston
kylejohnston / HTML-TEMPLATE.html
Last active January 10, 2020 17:04
A simple HTML document template
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>BOILERPLATE</title>
<link rel="stylesheet" href="css/styles.css">
</head>
<body>
@kylejohnston
kylejohnston / hype_pdf.sublime-snippet
Created September 29, 2018 05:26
Sublime snippet for generating PDFs from Processing + HYPE PDEs
<snippet><content><![CDATA[
// MOVE TO LINE 1
import processing.pdf.*;
// PLACE BEFORE CLOSING BRACE IN VOID SETUP()
saveVector();
noLoop();
} // CLOSE VOID SETUP()
void draw() {
H.drawStage();
@kylejohnston
kylejohnston / hype_img.sublime-snippet
Last active May 20, 2021 23:05
Sublime snippet for generating images from Processing + HYPE PDEs
<snippet><content><![CDATA[
// NOTE: set transparent background with H.CLEAR
// PLACE BEFORE CLOSING BRACE IN VOID SETUP()
saveHiRes(1); // define the scale factor
noLoop();
} // CLOSE VOID SETUP()
void draw() {
H.drawStage();
}
@kylejohnston
kylejohnston / processing.sublime-completions
Last active October 14, 2018 17:17
Hype Framework - Sublime Completions
{
"scope": "source.pde",
"completions":
[
// push pop matrix
{ "trigger": "push|pop|matrix", "contents": "\tpushMatrix();\n\t\ttranslate($1,$2,$3);\n\t\trotateX(radians($4));\n\t\trotateY(radians($5));\n\t\trotateZ(radians($6));\n\n\tpopMatrix();\n" },
// hello world
{ "trigger": "hello|world", "contents": "Hello World!" }
]
}
@kylejohnston
kylejohnston / hype.sublime-completions
Created October 14, 2018 17:16
Sublime completions for the Hype Frameworks extended classes
{
"scope": "source.pde",
"completions":
[
// behaviors
{ "trigger": "HAttractor", "contents": "import hype.extended.behavior.HAttractor;" },
{ "trigger": "HAttracted", "contents": "import hype.extended.behavior.HAttractor.HAttracted;" },
{ "trigger": "HAttractionForce", "contents": "import hype.extended.behavior.HAttractor.HAttractionForce;" },
{ "trigger": "HFollow", "contents": "import hype.extended.behavior.HFollow;" },
{ "trigger": "HMagneticField", "contents": "import hype.extended.behavior.HMagneticField;" },
@kylejohnston
kylejohnston / hype_environment.sublime-snippet
Created March 26, 2019 08:13
A starter environment for projects using Processing and the HYPE framework
<snippet><content><![CDATA[
${1:import processing.pdf.*;}
import hype.*;
// ENVIRONMENT VARIABLES *************************************************
// Screen: 1440×900; Dribbble: 800×600; HD: 1920×1080 or 960×540)
int stageW = 800;
int stageH = 600;
color clrBG = #242424;