Skip to content

Instantly share code, notes, and snippets.

@Metaxal
Metaxal / new-file-in-same-directory.rkt
Last active May 23, 2021 05:11
A quickscript to create a new file in the same directory as the current file and opens it in DrRacket
#lang racket/base
;;; License: [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0) or
;;; [MIT license](http://opensource.org/licenses/MIT) at your option.
(require quickscript
racket/string
racket/file
racket/path
racket/gui/base
@samdphillips
samdphillips / minitalk.rkt
Last active September 6, 2020 20:44
Very small single dispatch object language.
#lang racket/base
(struct %class [parent ivars methods] #:transparent)
(struct %object [class ivars] #:transparent)
(define (new class vals)
(%object class vals))
(define (send obj method-name args)
(define method (lookup-method (object-class obj) method-name))
@alex-hhh
alex-hhh / ishido.rkt
Created July 2, 2020 06:26
Ishido Game Impementation
#lang racket
;; Ishido Game Implementation
;; Copyright (c) 2020 Alex Harsányi (AlexHarsanyi@gmail.com)
;; Permission is hereby granted, free of charge, to any person obtaining a
;; copy of this software and associated documentation files (the "Software"),
;; to deal in the Software without restriction, including without limitation
;; the rights to use, copy, modify, merge, publish, distribute, sublicense,
;; and/or sell copies of the Software, and to permit persons to whom the
@Metaxal
Metaxal / raco-pkg-migrate.rkt
Last active November 12, 2021 14:35
When installing a new version of racket, run this script instead of just `raco pkg migrate <version-number-you-have-to-remember>`
#!/usr/bin/racket
#lang racket/base
;;; License: [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0) or
;;; [MIT license](http://opensource.org/licenses/MIT) at your option.
;; When installing a new version of Racket,
;; running this script setups all existing packages that had been installed
;; in the *user* scope.
;;
@naodesu
naodesu / resumedat_2015.rb
Last active May 23, 2022 09:53 — forked from stu43005/resumedat_2015.rb
Convert added torrents data from uTorrent (resume.dat) to qBittorrent (*.fastresume) format
# encoding: utf-8
# USE AT OWN RISK
#
# Follow this guide to install Ruby on Windows (step 1 and 2): https://forwardhq.com/support/installing-ruby-windows
# Install gems (with admin cmd prompt):
# https://rubygems.org/gems/bencode
# https://rubygems.org/gems/rest_client
#
# Edit datpath below to point to your utorrent resume.dat file
@Perlence
Perlence / thread-pool.rkt
Last active September 21, 2021 22:41
Straight-forward thread pool implementation in Racket
#lang racket/base
(require racket/match
racket/async-channel
net/http-client)
(define urls '(["icanhazip.com" "/"]
["icanhazepoch.com" "/"]
["example.com" "/"]))
@VimleshS
VimleshS / git-rebase.markdown
Created January 28, 2016 09:00 — forked from tmcgilchrist/git-rebase.markdown
Git rebase workflow

Checkout a new working branch

 git checkout -b <branchname>

Make Changes

 git add
 git commit -m "description of changes"

Sync with remote

@Metaxal
Metaxal / gist:5182719
Last active July 5, 2022 04:36
Example of using `yield', and related usages of Racket's GUI
#lang racket/gui
(define xmax 200)
(define ymax 200)
(define seconds-in-loop 3)
(define fr (new frame% [label ""]))
(define cv (new canvas% [parent fr] [min-width xmax] [min-height ymax]))
(define dc (send cv get-dc))
(send fr show #t)