Skip to content

Instantly share code, notes, and snippets.

@bluematt
bluematt / QuickTileset.gd
Created February 2, 2023 22:16
Quickly create a full TileSet on a TileMap with a single texture
tool
extends TileMap
export (Texture) var _texture:Texture setget _set_texture
func _set_texture(value:Texture) -> void:
if not Engine.is_editor_hint():
return
_texture = value

/var/www/.htaccess

Options +ExecCGI
AddHandler cgi-script .cgi
DirectoryIndex index.html index.php index.cgi
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.cgi?url=$1
@bluematt
bluematt / pipeline.cr
Created January 22, 2018 16:10
Crystal pipeline
module Callable
abstract def invoke(thing)
end
class Pipeline < Array(Callable)
include Callable
def process(thing)
self.each do |c|
thing = c.invoke(thing) if c.responds_to? :invoke
end
@bluematt
bluematt / crystal-ssl.md
Last active January 17, 2018 16:53
SSL issues with Crystal

Ubuntu 16.4

Trying to use the http library with Crystal, I kept getting this SSL error.

$ crystal app.cr
_main.o: In function `__crystal_main':
/usr/share/crystal/src/openssl/lib_ssl.cr:213: undefined reference to `SSL_library_init'
/usr/share/crystal/src/openssl/lib_ssl.cr:213: undefined reference to `SSL_load_error_strings'
/usr/share/crystal/src/openssl/lib_ssl.cr:213: undefined reference to `OPENSSL_add_all_algorithms_noconf'
@bluematt
bluematt / grid.scss
Created October 20, 2017 13:10
Simple flexible grid layout with spanning and positioning (SCSS)
// grid and columns
$columns: 16 !default;
$gutter: 10px !default;
.grid {
display: grid;
grid-template-columns: repeat($columns, 1fr);
grid-gap: $gutter;
.cell {

Keybase proof

I hereby claim:

  • I am bluematt on github.
  • I am bluematt (https://keybase.io/bluematt) on keybase.
  • I have a public key ASB846px7w2rS4twMB0jU3B5YL4z3yv1KOanUktTIIFjOgo

To claim this, I am signing this object:

# Your init script
#
# Atom will evaluate this file each time a new window is opened. It is run
# after packages are loaded/activated and after the previous editor state
# has been restored.
#
# An example hack to make opened Markdown files always be soft wrapped:
#
# path = require 'path'
#
@bluematt
bluematt / type.less.diff
Created September 14, 2013 18:48
Fix for the .h1—.h6 headings issue in https://gist.github.com/bluematt/6563820
diff --git a/less/type.less b/less/type.less
index 5ad6a46..cb1332d 100644
--- a/less/type.less
+++ b/less/type.less
@@ -89,9 +89,9 @@ h1, h2, h3, h4, h5, h6,
}
}
-h1,
-h2,
@bluematt
bluematt / h1-h6_headings.html
Created September 14, 2013 17:21
Example of the h1—h6 elements with the various .h1—.h6 mixin applied to each. Note the various top- and bottom- margins are inconsistent with the mixin as in Bootstrap 3.0.0
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Relative Heading Sizes with Twitter Bootstrap</title>
<meta name="author" content="bluematt@gmail.com">
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css">
<style type="text/css" media="screen">
.examples { margin-left: 40px; }
</style>