Skip to content

Instantly share code, notes, and snippets.

View ravinggenius's full-sized avatar
🤔
likely thinking

Thomas Ingram ravinggenius

🤔
likely thinking
View GitHub Profile
@ravinggenius
ravinggenius / sample.haml
Created November 11, 2012 01:49
Export XML passwords from Revelation password manager and convert to a CSV format that 1Password can import
-# this is an (incomplete) structure of the file that the script converts
%entry{:type => :folder}
%name Folder Name
-# forgot what type these entries are...
%entry{:type => :<not-folder>}
%name Name
%description Notes
%field{:id => 'generic-username'} Username
%field{:id => 'generic-password'} Password

paragraph one

paragraph two

{
"name": "dual-cjs-mjs-package",
"version": "1.0.0",
"description": "A package that can be both imported as esm and as cjs",
"main": "entry",
"scripts": {
"build": "babel *.mjs **/*.mjs --out-dir ."
},
"devDependencies": {
"babel-cli": "^6.26.0",
@ravinggenius
ravinggenius / resize.sh
Last active September 6, 2017 04:25
Batch resize images with ImageMagick
# place this script in whatever directory you have your albums in
# each album is expected to have an `original` sub-directory where the full-size images actually are
# resized images will be placed in a sibling directory next to `original`
# USAGE
# $ ./resize.sh "2017-09-04 Some Album Name" 1600
# rename arguments
ALBUM=$1 # the name of the directory containing the album (may contain spaces, which is why everything is quoted below)
SIZE=$2 # used to size a bounding box into which images will be resized (aspect ratio will be preserved)
// node_modules/react-icons/lib/fa/500px.js
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
@ravinggenius
ravinggenius / url.rip
Last active October 6, 2016 16:26
Resolve with current Rip semantics
URL = class {
@.initialize = => {
-> (scheme, user, password, host, port, path, query, fragment) {
@.scheme = scheme
@.user = user
@.password = password
@.host = host
@.port = port
@.path = path
@.query = query
@ravinggenius
ravinggenius / list.rip
Last active October 6, 2016 16:25
System.List.flatten
System.List = class<T> {
flatten = => {
-> (list<System.List>) {
switch (list.count) {
case (0) { list }
case (1) { [ self(list.head) ] }
else { [ ...self(list.head), ...self(list.tail) ] }
}
}
-> (object<System.Object>) { object }
@ravinggenius
ravinggenius / dragon.js
Last active August 10, 2016 23:55 — forked from Jingram17/dragon.js
var slaying = true;
// A bit of new math magic to calculate the odds
// of hitting the dragon. We'll cover this soon!
var youHit;
var damageThisRound;
var totalDamage = 0;
do {
youHit = Math.floor(Math.random() * 2);
@ravinggenius
ravinggenius / README.md
Last active August 10, 2016 03:38
Exploration of allowed mutations in Rip

Mutations to the currently-initializing object will be allowed in Rip.

Notes

  • Methods defined at the class level are typically written as a simple reference assignment.
  • @ inside a class refers to the class' prototype property. Properties defined on this object become instance methods.
  • @ inside a method refers to the method's receiver. (self refers to the method itself.)
require 'parslet'
module Rip::Parser::Atoms
class Pattern < Parslet::Atoms::Base
attr_reader :pattern
def initialize(pattern)
super()
@pattern = pattern
end