Skip to content

Instantly share code, notes, and snippets.

View lodestone's full-sized avatar
:octocat:
🤘Grokking Out 🤘

Matthew Petty lodestone

:octocat:
🤘Grokking Out 🤘
  • Kizmeta
  • Kansas City Area, Missouri
  • 17:01 (UTC -12:00)
View GitHub Profile
@lodestone
lodestone / hub-to-lab.js
Created March 7, 2015 14:46
Import a Github repo into Gitlab
// Currently this works if you change the token and run it through the console.
var fun = function() {
f=$($("form")[0]);
f.children(":input").val("");
f.prepend("<input name='private_token' value='<<<YOUR_PRIVATE_TOKEN>>>'/>");
f.prepend("<input name='name' value='"+$(".js-current-repository").text()+"'/>");
f.prepend("<input name='import_url' value='"+window.location+"'/>");
f.attr("action", "https://gitlab.com/api/v3/projects");
f.attr("method", "post");
f.submit();
@lodestone
lodestone / init.coffee
Created February 25, 2015 07:29
Port my web browser like behavior of spacebar to Atom Editor
atom.workspaceView.command 'line-jumper:move-down', ->
editor = atom.workspace.getActiveTextEditor()
editor.moveDown(10)
atom.workspaceView.command 'line-jumper:move-up', ->
editor = atom.workspace.getActiveTextEditor()
editor.moveUp(10)
%h1 This is the big header in HAML
%ul
%li First
%li Second
%li Third
%li Fourth
%a(href="https://google.com") Google Link
@lodestone
lodestone / Rakefile
Last active August 29, 2015 14:10 — forked from rjsamson/Rakefile
# -*- coding: utf-8 -*-
$:.unshift("/Library/RubyMotion/lib")
require 'motion/project/template/osx'
Motion::Project::App.setup do |app|
# Use `rake config' to see complete project settings.
app.name = 'MenubarApp'
app.info_plist['NSUIElement'] = 1
end
@lodestone
lodestone / 0-readme.md
Last active August 29, 2015 14:09 — forked from burke/0-readme.md

ruby-1.9.3-p327 cumulative performance patch for rbenv

This installs a patched ruby 1.9.3-p327 with various performance improvements and a backported COW-friendly GC, all courtesy of funny-falcon.

Requirements

You will also need a C Compiler. If you're on Linux, you probably already have one or know how to install one. On OS X, you should install XCode, and brew install autoconf using homebrew.

@lodestone
lodestone / isTheWebsiteDown.js
Last active August 29, 2015 14:08 — forked from Marak/isTheWebsiteDown.js
Checks to see if a website is down
var http = require('http');
module['exports'] = function isTheWebSiteDown (hook) {
http.get(hook.params.url, function(res){
hook.debug(hook.params.url + " is up and running.")
hook.res.end('false');
}).on('error', function (){
hook.debug(hook.params.url + " is DOWN!")
hook.res.end('true');
});
@lodestone
lodestone / echoHttpRequest.js
Last active August 29, 2015 14:08 — forked from Marak/echoHttpRequest.js
Echo HTTP requests
module['exports'] = function echoHttp (hook) {
hook.debug("Debug messages are sent to the debug console");
hook.debug(hook.params);
hook.debug(hook.req.path);
hook.debug(hook.req.method);
@lodestone
lodestone / GistList!.md
Created October 4, 2014 00:12
Try GistList for iOS! http://gistlist.io/

##alt text GistList: TODO for coders alt text

NeoBundle 'Shougo/unite.vim'
NeoBundle 'Shougo/unite-outline'
NeoBundle 'Sixeight/unite-grep'
NeoBundle 'basyura/unite-rails'
NeoBundle 'kmnk/vim-unite-giti'
NeoBundle 'thinca/vim-unite-history'
NeoBundle 'tsukkee/unite-help'
NeoBundle 'tsukkee/unite-tag'
NeoBundle 'ujihisa/unite-rake'
NeoBundle 'kopischke/unite-spell-suggest'
def parse(dices)
%r{^
(?<top_or_bottom>t|b)? # Flag for finding the top or bottom dice
(?<tb_number>\d)? # Number of top or bottom dice
\[(?<dice>.*)\] # The main dice string, to be parsed later
(?<explode>\*)? # Reroll (explode) die rolls? (i.e. 6 on 1d6)
(?<plus>(\+|\-)\d+)? # Additional points to add to roll (or subtract)
\=? # = Target Number or range follows...
(?<target>.*)?$ # The target number (single 4, range 4..6, above 4+, below 4-)
}x =~ dices