Skip to content

Instantly share code, notes, and snippets.

Marc Esher marcesher

Block or report user

Report or block marcesher

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View pig.log
worker-11
at java.lang.String.intern()Ljava/lang/String; (Native Method)
at clojure.lang.Symbol.intern(Ljava/lang/String;)Lclojure/lang/Symbol; (Symbol.java:62)
at clojure.lang.Keyword.intern(Ljava/lang/String;)Lclojure/lang/Keyword; (Keyword.java:53)
at clojure.core$keyword.invoke(Ljava/lang/Object;)Ljava/lang/Object; (core.clj:574)
at cfpb.qu.data$get_data_table$fn__4180$fn__4181.invoke(Ljava/lang/Object;)Ljava/lang/Object; (data.clj:176)
at clojure.core$map$fn__4207.invoke()Ljava/lang/Object; (core.clj:2485)
at clojure.lang.LazySeq.sval()Ljava/lang/Object; (LazySeq.java:42)
at clojure.lang.LazySeq.seq()Lclojure/lang/ISeq; (LazySeq.java:60)
at clojure.lang.ChunkedCons.chunkedNext()Lclojure/lang/ISeq; (ChunkedCons.java:59)
@marcesher
marcesher / gist:9863995
Created Mar 29, 2014
goimports_if_go.sh
View gist:9863995
#!/bin/sh
if [[ $1 == *.go ]]
then
goimports -w $1
fi
View browser_testing_question.md

These are questions about browser testing and state.

Imagine a large suite of browser tests that intend to deeply regression test an application. Like most web apps, this involves different types of state: user permissions, expected data in a database, etc. Testing the application requires logging in as different users and/or user types to test different views into the data.

  1. What are patterns for creating expected state prior to running browser tests?
  2. Is it appropriate for the browser tests to communicate directly with the database of the system under test, creating state in the same manner that you would in an integration test?
  3. How important is it that browser tests be decoupled from the application under test, such that the only thing required to run tests are the tests themselves, which can be pointed at any applicable URL (dev, test, staging)?
@marcesher
marcesher / test.py
Last active Aug 29, 2015
Strange hanging behavior with python httplib in one environment only
View test.py
# Problem: In only one environment, I see behavior with httplib where issuing a request against a FQDN will hang, but works fine with a URL without the domain
# eg request("GET", "http://google.com") hangs, but request("GET", "/") does not
# I only see this problem in one of our hosting environments, on both 2.6 and 2.7
# I cannot replicate it anywhere else
import httplib
cn = httplib.HTTPConnection("google.com", 80, timeout=5)
cn.set_debuglevel(10)
View Account.java
package edu.gmu.mut;
import java.util.ArrayList;
import java.util.Calendar;
/**
* Class Account represents an immutable customer account.
*/
public class Account {
@marcesher
marcesher / BadObject.cfc
Created Jan 12, 2012
cfc with no var scoping
View BadObject.cfc
component output="false"{
function loop1(){
x = 1;
for( x = 1; x LTE 100; x++ ){
writeLog("x is #x#");
loop2();
}
return x;
}
@marcesher
marcesher / gist:1662639
Created Jan 23, 2012
Synthesizing functions in javascript... practical applications?
View gist:1662639
From David Laing & Greg Malcolm's excellent javascript koans. I'm wondering: What are practical uses cases for this function synthesizing in javascript, where this approach would be preferable to all other possible approaches:
it("should use lexical scoping to synthesise functions", function () {
function makeIncreaseByFunction(increaseByAmount)
{
var increaseByFunction = function increaseBy(numberToIncrease)
{
return numberToIncrease + increaseByAmount;
};
@marcesher
marcesher / eff_you_var_scope
Created Feb 25, 2012
How many concurrent requests does it take to get into the throw?
View eff_you_var_scope
<cfcomponent>
<cffunction name="getArtist" output="false" access="public" returntype="any" hint="">
<cfargument name="id" type="numeric" required="true"/>
<cfquery datasource="cfartgallery" name="artist">
select *
from artists
where artistid = <cfqueryparam value="#arguments.id#" cfsqltype="cf_sql_integer"/>
</cfquery>
@marcesher
marcesher / ChatService.groovy
Created Aug 20, 2012
websocket chat example
View ChatService.groovy
class ChatService {
static transactional = false
static atmosphere = [mapping: '/atmosphere/chatty']
@marcesher
marcesher / ChatService.groovy
Created Sep 4, 2012
websocket broadcaster example
View ChatService.groovy
class ChatService {
static transactional = false
static atmosphere = [mapping: '/atmosphere/chat']
.....
You can’t perform that action at this time.