Skip to content

Instantly share code, notes, and snippets.


Dreftymac dreftymac

Block or report user

Report or block dreftymac

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View twistBox.pde
int[][] result;
float t, c;
float ease(float p) {
return 3*p*p - 2*p*p*p;
float ease(float p, float g) {
if (p < 0.5)
return 0.5 * pow(2*p, g);

Copied from

Basic HTML Meta Tags

<meta charset='UTF-8'>
<meta name='keywords' content='your, tags'>
<meta name='description' content='150 words'>
<meta name='subject' content='your website's subject'>
<meta name='copyright' content='company name'>
View html.tpl.php
* @file
* Default theme implementation to display the basic html structure of a single
* Drupal page.
* Variables:
* - $css: An array of CSS files for the current page.
* - $language: (object) The language the site is being displayed in.
textarcana /
Last active Jan 27, 2020
Convert Git logs to JSON. The first script ( is all you need, the other two files contain only optional bonus features 😀
#!/usr/bin/env bash
# Use this one-liner to produce a JSON literal from the Git log:
git log \
--pretty=format:'{%n "commit": "%H",%n "author": "%aN <%aE>",%n "date": "%ad",%n "message": "%f"%n},' \
$@ | \
perl -pe 'BEGIN{print "["}; END{print "]\n"}' | \
perl -pe 's/},]/}]/'
View gfm.rb
require 'digest/md5'
def gfm(text)
# Extract pre blocks
extractions = {}
text.gsub!(%r{<pre>.*?</pre>}m) do |match|
md5 = Digest::MD5.hexdigest(match)
extractions[md5] = match
You can’t perform that action at this time.