This file contains 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
<script setup lang="ts"> | |
import gsap from 'gsap' | |
import { ref } from 'vue' | |
const CardStates = ["Above", "Below"] as const | |
type CardState = typeof CardStates[number] | |
interface Card { | |
id: number |
This file contains 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
{-# LANGUAGE OverloadedStrings #-} | |
{-# LANGUAGE QuasiQuotes #-} | |
{-# LANGUAGE TemplateHaskell #-} | |
{-# LANGUAGE TypeFamilies #-} | |
{-# OPTIONS_GHC -Wno-unused-top-binds #-} | |
import Conduit | |
import Control.Monad (forever) | |
import Data.Text (Text) | |
import UnliftIO.STM |
This file contains 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
module Main (main) where | |
import Control.Concurrent.Async | |
import Control.Concurrent.Chan | |
import Control.Monad (forever) | |
import Data.Text (Text) | |
import Network.Wai | |
import Network.Wai.Handler.Warp | |
import Network.Wai.Handler.WebSockets | |
import Network.WebSockets |
This file contains 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
def paste_in(field_label, with:) | |
field = find_field(field_label) | |
selector = "##{field["id"]}" | |
script = <<-JS | |
dt = new DataTransfer(); | |
dt.setData("text/plain", '#{with}'); | |
ev = new ClipboardEvent("paste", { clipboardData: dt }); | |
$('#{selector}')[0].dispatchEvent(ev) | |
JS | |
page.execute_script(script) |
This file contains 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
Monban.configure do |config| | |
config.no_login_handler = ->(controller) do | |
notice = Monban.config.sign_in_notice | |
controller.flash.notice = notice.call | |
controller.redirect_to controller.login_path | |
end | |
end |
This file contains 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
class PostsController < ApplicationController | |
before_action :require_login | |
def show | |
render plain: "HERE" | |
end | |
end |
This file contains 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
require 'benchmark' | |
class TrieBuilder | |
def from_words(words) | |
TrieNode.new("").tap do |trie| | |
words.each { |word| trie.push_word(word) } | |
end | |
end | |
end |
This file contains 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
(ns cljs.pong.main | |
(:require [goog.dom :as dom] | |
[goog.events :as events])) | |
(def animate | |
(or (.-requestAnimationFrame js/window) | |
(.-webkitRequestAnimationFrame js/window) | |
(.-mozRequestAnimationFrame js/window) | |
#(.setTimeout js/window %1 (/ 1000 60)))) |
This file contains 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
require "json" | |
require "socket" | |
require "ipaddr" | |
require "securerandom" | |
require "curses" | |
class Message | |
attr_reader :client_id, :handle, :content | |
def self.inflate(json) |
This file contains 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>WebGL Example</title> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> | |
<script src="http://cdnjs.cloudflare.com/ajax/libs/gl-matrix/2.2.1/gl-matrix-min.js"></script> | |
<script id="shader-fs" type="x-shader/x-fragment"> | |
precision mediump float; | |
void main(void) { |
NewerOlder