Skip to content

Instantly share code, notes, and snippets.

View lonekorean's full-sized avatar

Will Boyd lonekorean

View GitHub Profile
@lonekorean
lonekorean / file.js
Created October 23, 2017 21:10
Matter.js setup
// engine
let engine = Matter.Engine.create();
// render
let render = Matter.Render.create({
element: document.getElementById('container'),
engine: engine,
options: {
width: SOME_WIDTH,
height: SOME_HEIGHT,
@lonekorean
lonekorean / file.css
Created May 8, 2017 22:55
Box model hack
div {
width: 122px; /* all browsers see this */
padding: 10px;
border: 1px solid red;
voice-family: "\"}\""; /* IE would give up here */
voice-family: inherit;
width: 100px; /* non-IE browsers see this corrected value */
}
@lonekorean
lonekorean / file.css
Created May 8, 2017 22:54
Simple box styles
div {
width: 100px;
padding: 10px;
border: 1px solid red;
}
@lonekorean
lonekorean / file.html
Last active May 10, 2017 22:45
Spacer GIF
<td>
This is web development!
<img src="spacer.gif" width="200" height="1">
</td>
@lonekorean
lonekorean / file.css
Created May 8, 2017 22:53
Border radius
border-radius: 10px;
@lonekorean
lonekorean / file.json
Created April 16, 2017 15:10
Part of package.json
"engines": {
"atom": ">=1.15.0 <2.0.0"
},
"providedServices": {
"autocomplete.provider": {
"versions": {
"2.0.0": "getProvider"
}
}
}
@lonekorean
lonekorean / file.js
Created March 5, 2017 18:11
Loading a single Gist via the API
const url = 'https://api.github.com/gists/8a6a3c508b7c71deb4070d3314900b1f';
function handleDone(data) {
// this assumes the gist has a single file
let filename = Object.keys(data.files)[0];
let code = data.files[filename].content;
$('pre').text(code);
$('h1').text(data.description);
}
@lonekorean
lonekorean / file.txt
Created March 5, 2017 17:35
Get a single Gist via the API
https://api.github.com/gists/8a6a3c508b7c71deb4070d3314900b1f
@lonekorean
lonekorean / file.js
Created March 5, 2017 17:26
Remove IDs from elements within Gists
let gistIdElements = document.querySelectorAll('.gist [id]');
Array.from(gistIdElements).forEach((el) => {
el.removeAttribute('id');
});
@lonekorean
lonekorean / file.css
Created March 3, 2017 02:23
Tweaking Gist colors with multiple filters
body .gist .blob-code {
filter: brightness(70%) saturate(150%);
}