Skip to content

Instantly share code, notes, and snippets.

View alexfaber2011's full-sized avatar

Alex Faber alexfaber2011

View GitHub Profile
@alexfaber2011
alexfaber2011 / complete
Created October 16, 2015 19:27
final_matrix
C G A T A C G T T
M: 0 Ix: 0 Iy: -2 ______ | M: -- Ix: -- Iy: -3 ______ | M: -- Ix: -- Iy: -4 ______ | M: -- Ix: -- Iy: -5 ______ | M: -- Ix: -- Iy: -6 ______ | M: -- Ix: -- Iy: -7 ______ | M: -- Ix: -- Iy: -8 ______ | M: -- Ix: -- Iy: -9 ______ | M: -- Ix: -- Iy: -10 ______ | M: -- Ix: -- Iy: -11 ______ |
A ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
M: -- Ix: 0 Iy: -- ______ | M: -1 Ix: -- Iy: -- :M____ | M: -4 Ix
C G A T A C G T T
M: 0 Ix: 0 Iy: -2 ______ | M: -- Ix: -- Iy: -3 ______ | M: -- Ix: -- Iy: -4 ______ | M: -- Ix: -- Iy: -5 ______ | M: -- Ix: -- Iy: -6 ______ | M: -- Ix: -- Iy: -7 ______ | M: -- Ix: -- Iy: -8 ______ | M: -- Ix: -- Iy: -9 ______ | M: -- Ix: -- Iy: -10 ______ | M: -- Ix: -- Iy: -11 ______ |
A ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
M: -- Ix: 0 Iy: -- ______ | M: -- Ix: -- Iy: -- ______ | M: -- Ix
M: 0 Ix: 0 Iy: -2 ______ | M: -- Ix: -- Iy: -3 ______ | M: -- Ix: -- Iy: -4 ______ | M: -- Ix: -- Iy: -5 ______ | M: -- Ix: -- Iy: -6 ______ | M: -- Ix: -- Iy: -7 ______ | M: -- Ix: -- Iy: -8 ______ | M: -- Ix: -- Iy: -9 ______ | M: -- Ix: -- Iy: -10 ______ | M: -- Ix: -- Iy: -11 ______ |
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
M: -- Ix: 0 Iy: -- ______ | M: -1 Ix: -- Iy: -- :M____ | M: -2 Ix: -- Iy: -4 :y__:M | M: -5 Ix: -- Iy: -5 :y__:y | M: -4 Ix: -- Iy: -6 :y__:y | M: -7 Ix: -- Iy: -7 :y__:y | M: -8 Ix: -- Iy: -8 :y__:y | M: -9 Ix: -- Iy: -9 :y__:y | M: -8 Ix: -- Iy: -10 :y__:y | M: -9 Ix: -- Iy: -11 :y__:y |
---------------------------------------------------
@alexfaber2011
alexfaber2011 / gist:248d733ab9bebc92a7f3
Last active October 16, 2015 16:51
-- : negative infinity
C G A T A C G T T
M: 0 Ix: 0 Iy: -2 ______ | M: -- Ix: -- Iy: -3 ______ | M: -- Ix: -- Iy: -4 ______ | M: -- Ix: -- Iy: -5 ______ | M: -- Ix: -- Iy: -6 ______ | M: -- Ix: -- Iy: -7 ______ | M: -- Ix: -- Iy: -8 ______ | M: -- Ix: -- Iy: -9 ______ | M: -- Ix: -- Iy: -10 ______ | M: -- Ix: -- Iy: -11 ______ |
A ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
M: -- Ix: 0 Iy: -- ______ | M: -1 Ix: -- Iy: -- :M____ | M: -4 Ix
@alexfaber2011
alexfaber2011 / sequence-inverter.clj
Created September 9, 2015 03:05
Inverts DNA sequences in the form of strings
(ns sequence-inverter.core
(:gen-class))
(defn invert-char
[char]
(let [char-map {"A" "C"
"C" "A"
"G" "T"
"T" "G"}]
(get char-map char)))
@alexfaber2011
alexfaber2011 / core.cljs
Created August 25, 2015 13:52
taste of clojurescript and reagent
(ns informacast-csv.core
(:require [informacast-csv.informormacast-communicator :as communicator]
[informacast-csv.zip-worker :as zip-worker]
[reagent.core :as reagent]
[reagent.session :as session]
[reagent-forms.core :refer [bind-fields]]
[goog.history.EventType :as EventType]
[goog.events :as events]
[secretary.core :as secretary :refer-macros [defroute]])
(:import goog.History))
func startLoad() {
ReachabilityManager.performOperationOnceReachable("SelfServiceViewController", onConnectionBlock: {
let rkObjectManager = RKObjectManager.sharedManager()
let dndFetchOperation = AFJSONRequestOperation(request: rkObjectManager.HTTPClient.requestWithMethod("GET", path: "users/\(AppPreferences.userId())/extensions/b77bb090-2fde-11e5-80c4-56847afe9799", parameters: nil))
let devicesFetchOperation = rkObjectManager.appropriateObjectRequestOperationWithObject(nil, method: .GET, path: "users/\(AppPreferences.userId())/devices", parameters: ["limit": 1000]) as! RKObjectRequestOperation
rkObjectManager.enqueueBatchOfObjectRequestOperations([devicesFetchOperation, dndFetchOperation], progress: nil, completion: { [weak self] operations -> Void in
let hasError = devicesFetchOperation.error != nil || dndFetchOperation.error != nil
if hasError {
if !devicesFetchOperation.cancelled && !
@alexfaber2011
alexfaber2011 / gist:f90123d5e5fb1bc8375f
Last active August 29, 2015 14:25
Clojurescript Debugging

Testing Results

3149a7b23a52abdd42f6e37c7b5ce5eaa71a47a8 - Localize both cli and cljs code

ERROR in (icm-anon-service.core-test/test-home) (:)
Uncaught exception, not in assertion.
expected: nil
  actual:
TypeError: 'null' is not an object (evaluating 'f.cljs$lang$maxFixedArity')
    at target/test.js:42883
//Gather all of the form fields
NSMutableArray *smsValues = [[NSMutableArray alloc] initWithCapacity:3];
NSMutableArray *phoneValues = [[NSMutableArray alloc] initWithCapacity:3];
NSMutableArray *emailValues = [[NSMutableArray alloc] initWithCapacity:3];
NSArray *smsCells = [self.smsTable visibleCells];
NSArray *phoneCells = [self.phoneCallTable visibleCells];
NSArray *emailCells = [self.emailTable visibleCells];
for(NSUInteger i = 0; i < smsCells.count; i++){
//Does the compiler optimize this?
@alexfaber2011
alexfaber2011 / ChallengeRESTClient.java
Created May 9, 2015 16:47
Converting JSONObject to POJO
return new Response.Listener<JSONArray>() {
@Override
public void onResponse(JSONArray response) {
VolleyLog.v(response.toString());
List<Challenge> challenges = new ArrayList<Challenge>();
//iterate over each JSONObject
for(int i = 0; i < response.length(); i++){
try {
JSONObject obj = (JSONObject) response.get(i);
String JSONString = obj.toString();