Skip to content

Instantly share code, notes, and snippets.

@schpet
schpet / machine.js
Created November 17, 2020 21:29
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@schpet
schpet / machine.js
Created January 14, 2020 05:58
Generated by XState Viz: https://xstate.js.org/viz
var CommandArgument = {
file: "file",
nearest: "nearest",
none: "none",
}
const findCommandErrorActions = assign({
workspace: (_context, event) => {
return event.data.workspace;
},
@schpet
schpet / machine.js
Created January 14, 2020 05:51
Generated by XState Viz: https://xstate.js.org/viz
const configMachine = Machine({
id: "config",
initial: "initial",
strict: true,
context: {
workspace: undefined,
errorMessage: undefined,
config: undefined,
},
states: {
@schpet
schpet / machine.js
Last active December 3, 2019 17:15
Generated by XState Viz: https://xstate.js.org/viz
const generationSucceeded = (c, e) => {
return e.generationResult && e.generationResult.ok
}
const generationStates = {
initial: "initial",
states: {
initial: {
on: {
GENERATE: [
diff --git db/migrate/20170712145519_add_unique_short_id_function.rb db/migrate/20170712145519_add_unique_short_id_function.rb
new file mode 100644
index 0000000..4342d8b
--- /dev/null
+++ db/migrate/20170712145519_add_unique_short_id_function.rb
@@ -0,0 +1,76 @@
+class AddUniqueShortIdFunction < ActiveRecord::Migration[5.1]
+ def up
+ # if needed:
+ # enable_extension 'pgcrypto'
@schpet
schpet / invalid_records.rake
Created February 18, 2016 19:35
Find all invalid ActiveRecord records
namespace "invalid_records" do
desc "Find all invalid records"
task find_all: :environment do
Rails.application.eager_load!
i = 0
invalid_records = ActiveRecord::Base.subclasses.map do |active_record_class|
begin
next if active_record_class&.abstract_class == true
ids = active_record_class.unscoped.pluck(:id)
diff --git a/src/containers/Root.js b/src/containers/Root.js
index fecb1e4..c2ad380 100644
--- a/src/containers/Root.js
+++ b/src/containers/Root.js
@@ -21,12 +21,12 @@ export default class Root extends React.Component {
if (__DEBUG__) {
if (__DEBUG_NEW_WINDOW__) {
if (!window.devToolsExtension) {
- require('../redux/utils/createDevToolsWindow').default(this.props.store)
+ require('../redux/utils/createDevToolsWindow')(this.props.store)

Keybase proof

I hereby claim:

  • I am schpet on github.
  • I am schpet (https://keybase.io/schpet) on keybase.
  • I have a public key whose fingerprint is E704 E886 111A 5A35 F26F C8EF DA72 7087 E288 6EE0

To claim this, I am signing this object:

"""
Outputs history with bash and git aliases expanded.
"""
import re
from subprocess import check_output
BASH_ALIASES = {}
#for line in check_output('bash -i -c "alias -p"', shell=True).split('\n'):
for line in check_output('zsh -i -c "alias"', shell=True).split('\n'):
@schpet
schpet / gifplease.sh
Created July 7, 2013 08:29
Turn a directory of jpegs into a gif
mogrify -format gif -resize 400 *.jpg
gifsicle --delay=20 --loop *.gif > yep.gif