Skip to content

Instantly share code, notes, and snippets.

View fractos's full-sized avatar
🌑
we are wolves we are not loved

Adam Christie fractos

🌑
we are wolves we are not loved
View GitHub Profile
@fractos
fractos / JTokenEx.cs
Last active August 29, 2015 14:13
Porting some Python code that generates a JSON Schema (Draft 4 compatible - http://json-schema.org/). Python original by @perenecabuto at - https://github.com/perenecabuto/json_schema_generator
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json.Linq;
namespace Xizi.Harness.Extensions
{
@fractos
fractos / scrape.py
Last active August 29, 2015 14:13
Some code that works for me ... (JournoCoders January 2015)
from bs4 import BeautifulSoup
from urllib2 import urlopen
from time import sleep # be nice
BASE_URL = "http://www.chicagoreader.com"
def make_soup(url):
html = urlopen(url).read()
return BeautifulSoup(html, "lxml")
@fractos
fractos / gist:064136bd475433f33552
Last active August 29, 2015 14:14
Protractor page object gist showing find and findAll functions
this.find = function(css) {
if(that.showdebug) { console.log('finding ' + css); }
return element(protractor.By.css(css));
};
this.findAll = function(css) {
if(that.showdebug) { console.log('finding all ' + css); }
return element.all(protractor.By.css(css));
};
@fractos
fractos / gist:639ee8ae3640fa4e6f88
Created January 31, 2015 14:02
Protractor page object code showing examples of use of find and findAll
this.contentsPanelThumbnailIncreaseSizeButton = function() {
return this.find('.leftPanel .galleryView .btn.size-up');
};
this.contentsPanelIndexTabSubTrees = function() {
return this.findAll('.treeView .tree li ul');
};
@fractos
fractos / gist:0613a0ecf87cf9fb16e8
Created January 31, 2015 14:49
Protractor page object code showing resetting the current frame for the next test
this.resetFrame = function(callback) {
if(that.showdebug) { console.log('switching to viewer frame'); }
ptor.switchTo().defaultContent().then(
function() {
that.sleep(that.frameSwitchDelay).then(
function() {
if (that.showdebug) { console.log('switching to frame[0]'); }
ptor.switchTo().frame(0).then(
function() {
if (that.showdebug) { console.log('switched'); }
@fractos
fractos / gist:a7f3a3409a978604fe6b
Last active August 29, 2015 14:14
Protractor test code showing use of resetFrame
var vp = new ViewerPage();
this.When(/^they click in the Thumbnails tab$/, function (callback) {
if(showsteps) { console.log("When they click in the Thumbnails tab"); }
var that = this;
vp.resetFrame(
function() {
vp.contentsPanelExpandThumbnailsButton().then(
function(contentsPanelExpandThumbnailsButton) {
contentsPanelExpandThumbnailsButton.click().then(

Keybase proof

I hereby claim:

  • I am fractos on github.
  • I am fractos (https://keybase.io/fractos) on keybase.
  • I have a public key whose fingerprint is 1156 4EFD E517 3DD1 30FE CC9B 0809 55D9 80FE 7F3D

To claim this, I am signing this object:

@fractos
fractos / web.config
Created March 18, 2015 10:04
log4net rig
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="log4net" publicKeyToken="1b44e1d426115821" culture="neutral" />
<codeBase version="1.2.10.0" href="bin\log4net.1.2.10\log4net.dll" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="log4net" publicKeyToken="669e0ddf0bb1aa2a" culture="neutral" />
<codeBase version="1.2.13.0" href="bin\log4net.1.2.13\log4net.dll" />
</dependentAssembly>
@fractos
fractos / IStore.cs
Created April 30, 2015 20:55
IStore interface
using System;
namespace Inversion.Data
{
public interface IStore : IDisposable
{
bool HasStarted { get; }
bool HasStopped { get; }
void Start();
@fractos
fractos / StoreState.cs
Created April 30, 2015 20:57
StoreState enumeration
namespace Inversion.Data
{
public enum StoreState
{
Unstarted,
Stopped,
Started
}
}