Skip to content

Instantly share code, notes, and snippets.

[
[
{
"c": "#ff6d1a",
"t": "#2b2c2e",
"a": 7
},
"esc\n\n\n\nsleep",
{
"c": "#d9dae0"
@bentglasstube
bentglasstube / Makefile
Created June 5, 2012 04:42
blosxom-git-deploy
.PHONY: all clean server
all: htdocs/index.html htdocs/style.min.css
htdocs/index.html: data/*
perl blosxom.cgi -password=awesome
find htdocs -mindepth 2 -name 'index.rss' -delete
htdocs/style.min.css: style.less
lessc -x style.less > htdocs/style.min.css
class Email {
public:
Email();
static Email* make_conference_email(const std::string& month);
static Email* make_angry_boss_email(const std::string& boss_name, int lives);
std::string from, subject, body;
bool conference;
};
class Email {
public:
Email();
static Email* make_conference_email(const std::string& month);
static Email* make_angry_boss_email(const std::string& boss_name, int lives);
std::string from, subject, body;
bool conference;
};
use Irssi;
use strict;
use FileHandle;
use vars qw($VERSION %IRSSI);
$VERSION = "1.0";
%IRSSI = (
authors => 'Alan Berndt <alan@eatabrick.org>',
name => 'auto_away',
@bentglasstube
bentglasstube / pinlock.tsk.xml
Last active December 18, 2015 19:39
Tasker profile to pin lock phone when not on home wifi.
<TaskerData sr="" dvi="1" tv="4.1u3m">
<Profile sr="prof6" ve="2">
<cdate>1371538376764</cdate>
<clp>true</clp>
<edate>1371851913695</edate>
<id>6</id>
<mid0>5</mid0>
<mid1>8</mid1>
<nme>Home</nme>
<State sr="con0">
John Holleran: How do I do "Q1 performance (70), refueling 20, pax 20" to "(70),20,20”
It really depends on what the whole data looks like not just one line, but I'll give it a shot. I have no idea how (un)familiar you are with regular expressions so I will assume you know nothing to err on the side of overexplanation.
As a warning, these are perl regular expressions. Whatever you are using has a different (and shittier) regex engine than perl does so some things might be a little bit different for you. If you tell me what language you are using, I might know more about its particular engine. If you tell me it is something that costs money like Oracle DB regex you are on your own, sorry.
Assuming that the text is mostly the same you could do something like
^Q[1-4] performance (\(\d+\)), refueling (\d+), pax (\d+)$
@bentglasstube
bentglasstube / gist:5020807
Created February 23, 2013 18:34
sunsong ranch macro
#showtooltip 3 3
/cleartarget
/tar tilled soil
/use [exists] 3 3; master plow
@bentglasstube
bentglasstube / quest.pl
Created November 27, 2012 19:12
Random quest generator
#!/usr/bin/perl
use strict;
use warnings;
my %data = (
subject => [
'A <modifier> <person> named <name>',
'A <modifier> <person> named <name>',
'<title> <name>',
@bentglasstube
bentglasstube / HexBase64.pm
Created September 16, 2012 01:14
Generate base64 to base16 look-up tables
package HexBase64;
use strict;
use warnings;
use base 'Exporter';
our @EXPORT = (qw(base64_to_hex hex_to_base64));
# lookup tables for conversion