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
" Vim syntax file | |
" Language: GreyScript | |
" Maintainer: Lyndon Armitage | |
" Latest Revision: 03 September 2020 | |
" To get working place in .vim/syntax | |
" Then you will want to make sure vim uses this file for .src files | |
" You could add the following to .vimrc | |
" au BufRead,BufNewFile *.src set filetype=greyscript |
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
import scala.collection.mutable | |
// The word wheel data | |
val required = List[Char]('a') | |
val otherChars = List[Char]('t', 'n', 'd', 'o', 'e', 'c', 'i', 'u') | |
// Load a word list and remove anything smaller than 2 letters | |
val wordList = scala.io.Source.fromInputStream(getClass.getResourceAsStream("/wordsEn.txt")) | |
.getLines() | |
.filter(_.length > 2) |
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
import java.io.File | |
import scala.collection.mutable | |
def sortWord(word: String) = new String(word.toCharArray.sorted) | |
val wordList = scala.io.Source.fromFile( | |
new File("wordsEn.txt")) | |
.getLines() | |
.filter(_.length > 2) |
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
package com.lyndonarmitage.daily.langton; | |
import javax.imageio.ImageIO; | |
import javax.swing.*; | |
import javax.swing.filechooser.FileFilter; | |
import java.awt.*; | |
import java.awt.image.BufferedImage; | |
import java.io.File; | |
import java.io.IOException; | |
import java.util.ArrayList; |
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
#.. | |
.## | |
##. |
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>jQuery Viewer Example</title> | |
<style type="text/css"> | |
body { | |
background: #0000FF; | |
} | |
#container { | |
margin-left: auto; |
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
/** | |
* Used to attach events to an element or object in a browser independent way | |
* @param element | |
* @param event | |
* @param callbackFunction | |
*/ | |
function attachEvent(element, event, callbackFunction) { | |
if(element.addEventListener) { | |
element.addEventListener(event, callbackFunction, false); | |
} |
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>Check if File is PDF on the Client Side</title> | |
</head> | |
<body> | |
<form id="uploadForm"> | |
<label>Upload a PDF: <input type="file" id="fileUpload" name="file" /></label> | |
</form> | |
<script type="text/javascript" src="js/checkPDF.js"></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
/** | |
* Setup and start an analog clock using a canvas | |
* @param canvas The canvas to use | |
* @param clockWidth The width of the clock (radius*2) | |
* @author Lyndon Armitage | |
*/ | |
function setupAnalogClock(canvas, clockWidth) { | |
var ctx = canvas.getContext("2d"); | |
var centerX = canvas.width / 2; | |
var centerY = canvas.height / 2; |
NewerOlder