Skip to content

Instantly share code, notes, and snippets.

View STRd6's full-sized avatar
🍑
https://whimsy.space

Daniel X Moore STRd6

🍑
https://whimsy.space
View GitHub Profile
// Created by STRd6
// MIT License
// jquery.paste_image_reader.js
(function($) {
var defaults;
$.event.fix = (function(originalFix) {
return function(event) {
event = originalFix.apply(this, arguments);
if (event.type.indexOf('copy') === 0 || event.type.indexOf('paste') === 0) {
event.clipboardData = event.originalEvent.clipboardData;
@STRd6
STRd6 / CoffeeTown.md
Created May 8, 2013 20:38
Some notes about CoffeeScript

The Basics

Variables

greeting = "hello"
location = "world"

x = 8

y = 3

<script>alert("yolo!")</script>
@STRd6
STRd6 / bjorx.rb
Created June 22, 2013 02:20
Save data to your local filesystem by posting to your webserver.
require "sinatra"
configure do
set :root, "."
set :public_folder, "."
end
# Any post to /save will write data to the path provided.
post '/save' do
data = params["data"]
+
-
*
/
%
^
|
&
**
<
@STRd6
STRd6 / haml.jison
Created June 27, 2013 04:05
Formalizing Haml
/* lexical grammar */
%lex
%%
\n return 'NEWLINE';
<<EOF>> return 'EOF';
" " return 'INDENT';
"-" return 'HYPHEN';
"(" return 'LEFT_PARENTHESIS';
@STRd6
STRd6 / sh.coffee
Created June 27, 2013 18:34
Like Rake's sh
{print} = require('sys')
{exec} = require('child_process')
sh = (cmd, fn=->) ->
print cmd
exec cmd, (error, stdout, stderr) ->
print(stdout)
if error
_____.___.      .__          _________            .__        __
\__  |   | ____ |  |   ____ /   _____/ ___________|__|______/  |_
 /   |   |/  _ \|  |  /  _ \\_____  \_/ ___\_  __ \  \____ \   __\
 \____   (  <_> )  |_(  <_> )        \  \___|  | \/  |  |_> >  |
 / ______|\____/|____/\____/_______  /\___  >__|  |__|   __/|__|
 \/                                \/     \/         |__|

YoloScript is a stupid little language with functions, objects, and messages.

@STRd6
STRd6 / model.coffee
Last active December 19, 2015 09:49
tickets: [
{name: "None", price: null}
{name: "Economy", price: 199.95}
{name: "Business", price: 449.22}
{name: "First Class", price: 1199.99}
]
chosenTicket: Observable()
resetTicket: ->
@chosenTicket(@tickets[0])
@STRd6
STRd6 / cors.xml
Last active December 19, 2015 13:29
Using Amazon S3 as a content addressable store.
<?xml version="1.0" encoding="UTF-8"?>
<CORSConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
<CORSRule>
<AllowedOrigin>*</AllowedOrigin>
<AllowedMethod>GET</AllowedMethod>
<MaxAgeSeconds>3000</MaxAgeSeconds>
<AllowedHeader>Content-*</AllowedHeader>
</CORSRule>
</CORSConfiguration>