Skip to content

Instantly share code, notes, and snippets.

View sentientmonkey's full-sized avatar

Scott Windsor sentientmonkey

View GitHub Profile
package sample;
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.stage.Stage;
import javafx.scene.web.WebEngine;
import javafx.scene.web.WebView;
public class Main extends Application {
require "zlib"
data = "the quick brown fox jumps over the lazy dog\n"
compressed_data = Zlib::Deflate.deflate data
File.write("saved_compressed_data", compressed_data)
read_compressed_data = File.read("saved_compressed_data")
a,b = read_compressed_data.bytes[0..1]
puts "%02x %02x" % [a, b]
{
"header": {
"Name": "MDErgo1",
"Layout": "Default",
"Base": "Blank",
"Version": "0.1",
"Author": "HaaTa (Jacob Alexander) 2015",
"KLL": "0.3c",
"Date": "2015-09-12",
"Generator": "KIICONF 0.2"
pub fn raindrops(n: u64) -> String {
match (n % 3, n % 5, n % 7) {
(0, 0, 0) => "PlingPlangPlong".to_string(),
(0, 0, _) => "PlingPlang".to_string(),
(0, _, 0) => "PlingPlong".to_string(),
(_, 0, 0) => "PlangPlong".to_string(),
(0, _, _) => "Pling".to_string(),
(_, 0, _) => "Plang".to_string(),
(_, _, 0) => "Plong".to_string(),
(_, _, _) => n.to_string(),
pub fn is_leap_year(year: u64) -> bool {
match (year % 4, year % 100, year % 400) {
(0, 0, 0) => true,
(0, 0, _) => false,
(0, _, _) => true,
(_, _, _) => false,
}
}

Keybase proof

I hereby claim:

  • I am sentientmonkey on github.
  • I am swindsor (https://keybase.io/swindsor) on keybase.
  • I have a public key ASCYmePBjcCJCBtfjZXf7CQVYrnzNbd-7yjGOE9AYutbZQo

To claim this, I am signing this object:

#lang racket
(require rackunit)
(provide return-id bind-id return-maybe bind-maybe fail-maybe do)
(define return-id (λ (a) a))
(define bind-id (λ (ma f) (f ma)))
(define plus-id
#lang racket
(require rackunit)
(provide return-id bind-id return-maybe bind-maybe fail-maybe do)
(define return-id (λ (a) a))
(define bind-id (λ (ma f) (f ma)))
(define plus-id
#lang racket
(require rackunit)
(provide Nothing Just Maybe whenJust orElse)
(define (Nothing)
(lambda () #f))
(define (Just a)
require 'minitest/autorun'
module ExclusiveRange
refine Range do
def rinclude? value
self.begin < value && value <= self.end
end
end
end