Skip to content

Instantly share code, notes, and snippets.

View philsinatra's full-sized avatar
🤘

Phil Sinatra philsinatra

🤘
View GitHub Profile
@philsinatra
philsinatra / .stylintrc
Created November 10, 2017 18:11
Stylint Configuration File
{
"blocks": false,
"brackets": "never",
"colons": "never",
"colors": "always",
"commaSpace": "always",
"commentSpace": "always",
"cssLiteral": "never",
"customProperties": [],
"depthLimit": false,
@philsinatra
philsinatra / .eslintrc
Created November 10, 2017 18:10
ESLint Configuration File
{
"env": {
"es6": true,
"browser": true
},
"extends": "eslint:recommended",
"rules": {
"no-console": 0,
"no-global-assign": ["error", { "exceptions": ["Object"] }],
"indent": 0,
@philsinatra
philsinatra / .babelrc
Created November 10, 2017 18:10
Babel Configuration File
{
"presets": ["env"]
}
@philsinatra
philsinatra / .jsbeautifyrc
Created November 9, 2017 16:19
Config file for JSBeautify
{
"html": {
"allowed_file_extensions": ["htm", "html", "xhtml", "shtml", "xml", "svg", "dust"],
"brace_style": "collapse", // [collapse|expand|end-expand|none] Put braces on the same line as control statements (default), or put braces on own line (Allman / ANSI style), or just put end braces on own line, or attempt to keep them where they are
"end_with_newline": true, // End output with newline
"indent_char": " ", // Indentation character
"indent_handlebars": true, // e.g. {{#foo}}, {{/foo}}
"indent_inner_html": false, // Indent <head> and <body> sections
"indent_scripts": "keep", // [keep|separate|normal]
"indent_size": 2, // Indentation size
<p><em>Select play to begin the video presentation.</em>
</p>
<div title="This is a video describing the System Safety Process. The play button will begin the video.">
<video height="360" width="640" poster="../media/5114/WO57_02-poster.jpg" preload controls>
<source src="../media/5114/WO57_02.mp4" type="video/mp4" />
<source src="../media/5114/WO57_02.webm" type="video/webm" />
<track default="" kind="captions" label="Captions" src="../media/5114/WO57_02.vtt" srclang="en" />
</video>
</div>
@philsinatra
philsinatra / volume_control.html
Created January 16, 2017 16:39
Javascript Volume Control
<video src="https://cdn.brad.is/videos/curiosity.mp4" id="video" width="640" height="360" controls> </video>
<script type="text/javascript">
var video = document.getElementById('video');
video.addEventListener("volumechange", function() {
console.log('Volume changed.');
console.log('Current volume: ' + video.volume);
var set_volume = localStorage.setItem('wo14_vol', video.volume);
@philsinatra
philsinatra / Sketch Custom Plugin - Default
Created December 21, 2016 15:21
The default Custom Plugin script that comes with Sketch
log('This is an example Sketch script.');
var documentName = context.document.displayName();
log('The current document is named: ' + documentName);
var selectedLayers = context.selection;
var selectedCount = selectedLayers.count();
if (selectedCount == 0) {
log('No layers are selected.');
@philsinatra
philsinatra / obj_loop.js
Created November 16, 2015 19:05
Loop Through A JS Obect
var myObj = {
Whatever_Property : [
['one', 'fish'],
['two', 'fish'],
['red', 'fish'],
['blue', 'fish']
],
Some_Other_Property : [
['A Title', 'filename.jpg'],
['Another Title', 'filename2.jpg']
@philsinatra
philsinatra / css-system-fonts.css
Created October 29, 2015 13:41
CSS System Fonts
/* https://medium.com/@mwichary/system-shock-6b1dc6d6596f#.pth6mnqx0 */
font-family: -apple-system, ".SFNSText-Regular", "San Francisco", "Oxygen", "Ubuntu", "Roboto", "Segoe UI", "Helvetica Neue", "Lucida Grande", sans-serif;
@philsinatra
philsinatra / js-alert-message
Created June 25, 2015 14:05
Alert javascript errors
window.onerror = function(msg, url, linenumber) {
window.alert('Error message: '+msg+'\nURL: '+url+'\nLine Number: '+linenumber);
return true;
}