Skip to content

Instantly share code, notes, and snippets.

Avatar

Steve Jabour atsjj

View GitHub Profile
@atsjj
atsjj / index.js
Created Sep 16, 2020
p5js scene state
View index.js
let currentScene = 1;
function setup() {
createCanvas(400, 400);
}
function mouseClicked() {
if (currentScene == 1) {
currentScene = 2;
} else {
@atsjj
atsjj / components.spinner\.js
Last active Aug 25, 2020
Spinner Component
View components.spinner\.js
import Component from '@glimmer/component';
import { action } from '@ember/object';
import { task, timeout } from 'ember-concurrency';
import { tracked } from '@glimmer/tracking';
export default class extends Component {
@tracked debounce = this.args.debounce || 0;
@tracked input = null;
@tracked value = this.args.value || 0;
@atsjj
atsjj / compact.hbs
Last active Apr 17, 2020
auto-changelog-templates
View compact.hbs
{{#each releases}}
{{#if @first}}
{{#each merges}}
* ({{id}}) {{{message}}}
{{/each}}
{{#each fixes}}
* {{{commit.subject}}}{{#each fixes}} ({{id}}){{/each}}
{{/each}}
{{#each commits}}
* ({{shorthash}}) {{#if breaking}}**Breaking change:** {{/if}}{{{subject}}}
View index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Center text in SVG rect -- horz and vert</title>
</head>
<body>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 1140 400">
<defs>
<style>
View index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Center text in SVG rect -- horz and vert</title>
</head>
<body>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 1140 400">
<defs>
<style>
View launch.json
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Launch File",
"protocol": "inspector",
"request": "launch",
View components.my-component.js
import Ember from 'ember';
export default Ember.Component.extend({
classNameBindings: ['isVisible:show']
});
View ember-cli-build.js
/* global require, module */
var EmberApp = require('ember-cli/lib/broccoli/ember-app');
module.exports = function(defaults) {
var app = new EmberApp(defaults, {
'ember-cli-foundation-sass': {
'modernizr': true,
'fastclick': true,
'foundationJs': 'all'
}
View ent-analysis.txt
» ent halos.raw
Entropy = 7.428127 bits per byte.
Optimum compression would reduce the size
of this 376 byte file by 7 percent.
Chi square distribution for 376 samples is 254.47, and randomly
would exceed this value 49.76 percent of the times.
Arithmetic mean value of data bytes is 115.1941 (127.5 = random).
View index.html
<!DOCTYPE html>
<meta charset="utf-8">
<canvas id='c'></canvas>
<script type="text/javascript">
document.addEventListener('DOMContentLoaded', function() {
var canvas = document.getElementById('c');
canvas.width = canvas.height = 465;
var context = canvas.getContext('2d');
You can’t perform that action at this time.