Skip to content

Instantly share code, notes, and snippets.

View kariudo's full-sized avatar
😭
Miserable

Hunter Horsman kariudo

😭
Miserable
  • Square 9 Softworks
  • CT
View GitHub Profile
@kariudo
kariudo / home.erb
Created May 30, 2013 00:57
example episode
[<#Tvdbr::Episode absolute_number=nil airsafter_season=nil airsbefore_episode="6" airsbefore_season="1" combined_episodenumber="0" combined_season="0" director=nil dvd_chapter=nil dvd_discid=nil dvd_episodenumber=nil dvd_season=nil ep_img_flag=nil episode_name="Contingency Plan. Complete Summary One Piece" episode_number="0" filename=nil first_aired="1999-12-22" guest_stars=nil id="1711991" imdb_id=nil language="en" lastupdated="1319395933" overview=nil production_code=nil rating="7.0" rating_count="1" season_number="0" seasonid="31892" seriesid="81797" writer=nil>, <#Tvdbr::Episode absolute_number=nil airsafter_season=nil airsbefore_episode="1" airsbefore_season="2" combined_episodenumber="1" combined_season="0" director="Goro Taniguchi" dvd_chapter=nil dvd_discid=nil dvd_episodenumber=nil dvd_season=nil ep_img_flag="2" episode_name="One Piece: Defeat the Pirate Ganzack! (OVA 1)" episode_number="1" filename="episodes/81797/619671.jpg" first_aired="1998-07-26" guest_stars="Ikuya Sawaki|Jun Tanaka|Norio Wakamo
@kariudo
kariudo / binary_search.js
Last active August 29, 2015 14:00
Binary Search sorted list object
function SortedList() {
this.length = 0;
this.list = [];
}
SortedList.prototype.add = function(val) {
this.list.splice(findSpot(this.list,val,this.length)+1,0,val);
this.length++;
}
SortedList.prototype.get = function(i) {
@kariudo
kariudo / snailsort.js
Created April 25, 2014 13:21
Snail Sort
snail = function(array) {
var result = [];
var n=array.length;
var x=n;
var y=n;
if(n==1){
return array[0];
}
while(y>1){
for(j=0;j<y;j++){
@kariudo
kariudo / gist:e95ab97ea509b5ab7878
Last active August 29, 2015 14:01
Select jQuery based on data attribute
$("htmltag[data-field='" + current +"']");
$("[data-api='Foobar'][data-field='name']").text();
- <CaptureWorkflowLog xmlns="http://schemas.datacontract.org/2004/07/Square9.Objects.XMLImport" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
- <Items>
- <CaptureWorkflowLogEntry>
<BatchId>4</BatchId>
- <History>
- <CaptureWorkflowLogEntryItem>
<DocItemId />
<Message>Importing file into batch: E:\Scans\Med Tech 1\MEDTECH1.pdf</Message>
<MessageCategory>Process</MessageCategory>
<Step>File Import</Step>

APIDocs


This project was created to allow for easy updating of our publicly documented API methods. It uses its own API to handle the maintenance of documentation so it is affectionatly refered to by me as MetaDocs.

  • API docs are all saved in their own .JSON files in the configured location.
  • Dispaly pages are generated on the fly from templates using .JSON data.

Project Setup

@kariudo
kariudo / todoWarn.js
Created September 23, 2015 13:50
Javascript "Todo" Warning (With Caller) Function
// Used as a UI indicaiton that a feature is not complete. Warns to log.
var TODO = function () {
var callerName = "";
try { //noinspection ExceptionCaughtLocallyJS
throw new Error(); }
catch (e) { callerName = /TODO.+\n\s+at (.+) \(/.exec(e.stack)[1]; }
console.warn('Feature not complete:', callerName);
};
@kariudo
kariudo / makeDoubleGreatAgain.vb
Last active May 5, 2017 14:26
A little fiddle to parse a decimal string in the context of multiple cultures.
Imports System
Public Module Module1
Public Sub Main()
Console.WriteLine(Decimal.Parse("-2"))
Console.WriteLine(MakeDoubleGreatAgain("-3.33"))
End Sub
'Parse assorted cutlures for doubles
Public Function MakeDoubleGreatAgain(value As String) As Double
// Converts nested objects and arrays into camelCase, when they were PascalCase to start with
var convert2Camel = function(obj) {
if (Object.prototype.toString.call(obj) === '[object Array]') {
var a = [];
obj.forEach(function(element) {
a.push(convert2Camel(element));
});
return a;
} else {
if (typeof obj == 'object')
We couldn’t find that file to show.