Skip to content

Instantly share code, notes, and snippets.

View bantic's full-sized avatar
💭
Status!

Cory Forsyth bantic

💭
Status!
View GitHub Profile
@bantic
bantic / .eslintrc.js
Created April 16, 2025 08:15
test eslint ecmaVersion for ts parser
// eslint-disable-next-line no-undef
module.exports = {
parser: "@typescript-eslint/parser",
parserOptions: {
ecmaVersion: 2015,
},
plugins: ["@typescript-eslint"],
extends: ["plugin:@typescript-eslint/recommended"],
rules: {
"@typescript-eslint/no-explicit-any": "off",
@bantic
bantic / index.html
Created April 15, 2025 08:57
simple html timer
<html>
<body>
<style>
.container {
display: flex;
align-items: center;
justify-content: center;
height: 100vh;
flex-direction: column;
}
@bantic
bantic / .eslintrc.js
Last active April 14, 2025 10:15
test eslint ecmaVersion impact
// eslint-disable-next-line no-undef
module.exports = {
// If the line below is commented out, the eslint default parser is used,
// and the parserOptions.ecmaVersion becomes meaningful; it must be incremented
// to a value greater than 2024 to parse the entire test.js file.
// When the babel eslint-parser is used, the ecmaVersion option is ignored.
parser: "@babel/eslint-parser",
parserOptions: {
ecmaVersion: 2017,
requireConfigFile: false,
@bantic
bantic / bin.js
Last active February 21, 2025 14:13
npx create test
#!/usr/bin/env node
console.log('hello from npx-create-test bin.js');
@bantic
bantic / README.md
Last active January 28, 2022 11:57
Example using kubernetes StatefulSet to target a CronJob to a specific pod

Example showing how to use a StatefulSet in coordination with a CronJob to run a scheduled command on a specific pod.

Download k8s.yaml locally and then run:

kubectl apply -f k8s.yaml && \
  kubectl rollout status statefulset/web && \
  sleep 65 && \
  for podNum in 0 1 2; do echo -n "Pod $podNum: "; kubectl exec pod/web-$podNum -- ls -1 / | grep cron || echo "<notfound>"; done
@bantic
bantic / find-string-in-file-at-tag.mjs
Created September 28, 2021 10:08
zx: go back through tags to look for a specific string in a file
#!/usr/bin/env zx
$.verbose = false;
const MAX_v2_MINOR = 18;
let version = { major: 3, minor: 28, patch: 0 };
version.toString = function () {
return `v${this.major}.${this.minor}.${this.patch}`;
};
version.decrementMinor = function () {
chrome.runtime.onMessage.addListener(function(color) {
if (color === 'changeToYellow') {
document.body.style.color = 'yellow';
}
});
@bantic
bantic / controllers.application.js
Last active December 4, 2019 19:24
Ember 2.12.2 Set Mutations
import Ember from 'ember';
let num = 4;
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
emberVersion: Ember.VERSION,
init() {
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
veryLongString: Ember.computed(function() {
let str = '';
for (let i = 0; i < 10; i++) {
for (let ch = 65; ch < 65+26; ch++) {
str += String.fromCharCode(ch);
}
import Ember from 'ember';
export default Ember.Component.extend({
actions: {
update(e) {
let srcValue = e.target.value;
let parsedValue = parseFloat(srcValue);
if (!Number.isNaN(parsedValue)) {
this.sendAction('didChange', parsedValue);