Skip to content

Instantly share code, notes, and snippets.

View scottlingran's full-sized avatar

Scott Lingran scottlingran

  • Melbourne, Australia
View GitHub Profile
@scottlingran
scottlingran / liar.js
Last active June 14, 2024 08:09
The Liar paradox is not so paradoxical if seen as an automata.
class Automata {
constructor() {
this.sentence = false;
}
run() {
while (true) {
console.log(`This sentence is ${this.sentence}.`);
if (this.sentence === false) {
this.sentence = true;
function cdf(x, mean, variance) {
return 0.5 * (1 + erf((x - mean) / (Math.sqrt(2 * variance))));
}
function erf(x) {
// save the sign of x
var sign = (x >= 0) ? 1 : -1;
x = Math.abs(x);
// constants
ffmpeg -i Untitled.mov -r 30 -f gif - | gifsicle --optimize=3 > Untitled.gif
import numpy
import six
from modelfile import model
# Inputs
positive = []
negative = []
# add weights for each word, if not already present;
# default to 1.0 for positive and -1.0 for negative words
AALS.co
ABBS.co
ABYE.co
ACYL.co
ADAW.co
ADZE.co
AERY.co
AESC.co
AGLU.co
AGLY.co
require 'json'
require 'time'
require 'csv'
file = File.open("messages.json").read
messages = JSON.parse(file)
# consolidate
require 'nokogiri'
require 'time'
require 'json'
module Parser
extend self
def message(el)
raise "Requires Nokogiri::XML::Element" if el.class != Nokogiri::XML::Element
### Keybase proof
I hereby claim:
* I am locksley on github.
* I am scottli (https://keybase.io/scottli) on keybase.
* I have a public key whose fingerprint is 4B9E 5CA6 E95F 1F90 8716 7817 C525 F672 8D53 8B5B
To claim this, I am signing this object:
var client = require("client")
client.on("navdata", function(data) {
if (condition === true) {
FlightController.doCoolStuff(data)
} else {
FlightController.reset()
}
})
var person = {
firstName: "JSON",
lastName: "Lim"
};