Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env lua
Set = {}
Set.mt = {}
function Set.new (t)
local set = {}
setmetatable(set, Set.mt)
for _, l in ipairs(t) do set[l] = true end
return set
Func<bool> checkUpdates = () => autoUpdates.checkUpdates("ParseModXIV");
checkUpdates.BeginInvoke(result =>
{
if(checkUpdates.EndInvoke(result)) MessageBox.Show("Update Available! For Full Functionality, Please Goto https://secure.ffxiv-app.com/products/ & Download The Latest Release.", "Information!");
autoUpdates.checkDLLs("AppModXIV", "");
}, null);
<Page
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:Monitors="clr-namespace:ParseModXIV.Monitors"
Height="300" Width="300">
<Grid>
<Grid.Resources>
<Monitors:DamageMonitor x:Key="DamageMonitor" />
<DataTemplate x:Key="statRow">
<ListBoxItem>
<Grid>
@andry1
andry1 / gist:1156010
Created August 19, 2011 04:06
flickr photo xaml databinding w/ templates
<Page
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Grid>
<Grid>
<Grid.Resources>
<XmlDataProvider x:Key="flickrdata" Source="http://api.flickr.com/services/feeds/photos_public.gne?tags=flower&amp;lang=en-us&amp;format=rss_200">
<XmlDataProvider.XmlNamespaceManager>
<XmlNamespaceMappingCollection>
<XmlNamespaceMapping Prefix="media" Uri="http://search.yahoo.com/mrss/"/>
@andry1
andry1 / gist:1165823
Created August 23, 2011 16:48
RegEx Misses
  1. [Damage] No RegEx match for line "Star Killer uses War Drum on Tarbh Uisge."
  2. [Damage] No RegEx match for line "Tarbh Uisge evades Sophia Ainslade's Light Shot."
  3. [Damage] No RegEx match for line "Tarbh Uisge evades Viper Grendal's Heavy Swing."
  4. [Damage] No RegEx match for line "Tarbh Uisge evades Viper Grendal's Heavy Swing."
  5. [Damage] No RegEx match for line "Tarbh Uisge evades Sophia Ainslade's Light Shot."
@andry1
andry1 / gist:1168685
Created August 24, 2011 17:54
Latest Regex Results
  1. No RegEx match for line "Viper Grendal's Defender II removes Viper Grendal's Defender effect."
  2. No RegEx match for line "Angel Ofchaos is well fed."
  3. No RegEx match for line "Viper Grendal's Defender II removes Viper Grendal's Defender effect."
  4. No RegEx match for line "Sophia Ainslade's Light Shot removes Sophia Ainslade's Raging Strike effect."
  5. No RegEx match for line "Sophia Ainslade's Light Shot removes Sophia Ainslade's Hawk's Eye effect."
#!/usr/bin/env node
r = new RegExp("^(\w+)\s+")
str = "abc 123"
console.log("testing new RegExp(...) [non-compiled]")
start = Date.now()
for(i = 0; i < 10000000; ++i) {
str.match(r)
}
@andry1
andry1 / gist:2925651
Created June 13, 2012 18:24
avro-c code to dump out schema and records from avro datafile as json
#include <stdio.h>
#include <avro.h>
int main(int argc, char **argv) {
avro_file_reader_t reader;
avro_writer_t stdout_writer = avro_writer_file_fp(stdout, 0);
avro_schema_t schema;
avro_datum_t record;
char *json=NULL;
@andry1
andry1 / gist:3919831
Created October 19, 2012 18:29
Quasi Output
[ruby-1.9.3-p194] (master)
[02:19 PM] chris@apocalypse ~/src/collective/quasi/automati$ VBoxManage --version
4.1.23r80870
[02:20 PM] chris@apocalypse ~/src/collective/quasi/automati$ vagrant --version
Vagrant version 0.9.0
[ruby-1.9.3-p194] (master)
[02:13 PM] chris@apocalypse ~/src/collective/quasi$ git pull origin master
From github.com:collectivemedia/quasi
* branch master -> FETCH_HEAD
@andry1
andry1 / gist:5152739
Created March 13, 2013 14:39
Example HTTPFS communication using curl+kerberos
#!/bin/bash
#
# Uses a keytab to auth to kerberos and then creates an empty file/directory
# to notify oozie that data is ready.
# Specify the name of the dataset to notify for as the first argument,
# and optionally the day in UTC during which the data is intended to be loaded
# (defaults to the current day in UTC)
# e.g. :
#