This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const filterSubStates = filterName => ({ | |
initial: "disabled", | |
states: { | |
disabled: { | |
on: { [`ENABLE_${filterName}`]: "enabled" } | |
}, | |
enabled: { | |
initial: "asc", | |
on: { | |
[`DISABLE_${filterName}`]: "disabled" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const assetManagerViewMachine = Machine( | |
{ | |
id: "assetManagerView", | |
initial: "closed", | |
context: { | |
assetsSelected: 0 | |
}, | |
states: { | |
closed: { | |
on: { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const toastMachine = Machine({ | |
id: 'toast', | |
initial: 'poweredOff', | |
states: { | |
poweredOff: { | |
on: { POWER_ON: 'poweredOn.hist' } | |
}, | |
poweredOn: { | |
on: { POWER_OFF: 'poweredOff' }, | |
type: 'parallel', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const lightBulbMachine = Machine({ | |
id: 'lightBulb', | |
initial: 'unlit', | |
states: { | |
unlit: { | |
on: { | |
BREAK: 'broken', | |
TOGGLE: 'lit' | |
} | |
}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { createConnection, getConnection, Entity, getRepository } from "typeorm"; | |
import { PrimaryGeneratedColumn, Column } from "typeorm"; | |
@Entity() | |
export class MyEntity { | |
@PrimaryGeneratedColumn() | |
id?: number; | |
@Column() | |
name?: string; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Spotify ad skipper | |
// @version 1.0 | |
// @namespace http://tampermonkey.net/ | |
// @description Detects and skips ads on spotify | |
// @match https://*.spotify.com/* | |
// @grant none | |
// @run-at document-start | |
// @downloadURL https://gist.githubusercontent.com/Simonwep/24f8cdcd6d32d86e929004013bd660ae/raw | |
// @updateURL https://gist.githubusercontent.com/Simonwep/24f8cdcd6d32d86e929004013bd660ae/raw |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package global; | |
import java.util.ArrayList; | |
import java.util.List; | |
import java.util.Map; | |
import java.util.Scanner; | |
import java.awt.AWTException; | |
import java.awt.GraphicsEnvironment; | |
import java.awt.HeadlessException; | |
import java.awt.Rectangle; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* This is a PayPal IPN (Instant Payment Notification) broadcaster | |
* Since PayPal does not provide any straightforward way to add | |
* multiple IPN listeners we'll have to create a central IPN | |
* listener that will broadcast (or filter and dispatch) Instant | |
* Payment Notifications to different destinations (IPN listeners) | |
* | |
* http://codeseekah.com/2012/02/11/how-to-setup-multiple-ipn-receivers-in-paypal/ | |
* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Calculate VWAP (volume weighted average price) for a list of bids. | |
* | |
* @param {number} total - Total shares bought. | |
* @param {Array<number, number>} positions - Tuples of position data. The first | |
* index is the amount of shares, the | |
* second index is the price of the | |
* shares. | |
* | |
* @example |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
====== Inexplicably it just worked... I think. Those ff's are fairly ominous ===================== | |
pentoo ~ # goodfet.bsl --dumpinfo > info.txt | |
Use -h for help | |
Use --fromweb to upgrade a GoodFET. | |
MSP430 Bootstrap Loader Version: 1.39-goodfet-8 | |
Invoking BSL... | |
Transmit default password ... | |
Current bootstrap loader version: 2.13 (Device ID: f26f) | |
pentoo ~ # cat info.txt |