Skip to content

Instantly share code, notes, and snippets.

View cwndrws's full-sized avatar

Charlie Andrews cwndrws

  • GitHub
  • RVA
View GitHub Profile
@cwndrws
cwndrws / ClearBlade-iOS-API.podspec
Last active December 27, 2015 10:29
The podspec for the ClearBlade iOS API
Pod::Spec.new do |s|
s.platform = :osx
s.platform = :ios
s.name = "ClearBlade-iOS-API"
s.version = "0.8.7"
s.summary = "iOS API libraries for the ClearBlade platform"
s.ios.deployment_target = '7.0'
s.ios.frameworks = 'MobileCoreServices', 'SystemConfiguration', 'Security', 'CoreGraphics'
@cwndrws
cwndrws / gist:7751393
Created December 2, 2013 15:44
The request JSON that fails
{"item_id":"35ed0538-5217-11e3-89b6-bc764e0487f9","old_value":0,"new_value":"22","column":"age"}
@cwndrws
cwndrws / properEqQuery
Last active December 31, 2015 03:59
Proper query
[[{"EQ": [{"stringColumn": "Hello"}]}]]
[[{"EQ": [{"stringColumn": "Hello"}, {"nameColumn": "Tyler"}]}]] = stringColumn = Hello AND nameColumn = Tyler
[[{"EQ": [{"nameColumn": "Tyler"}]}, {"GT":[{"ageColumn": 20}]}]] = nameColumn = Tyler AND ageColumn > 20
[[{"EQ": [{"nameColumn": "Tyler"}]}], [{"EQ": [{"nameColumn": "Charlie"}]}]] = nameColumn = Tyler OR nameColumn = Charlie
@cwndrws
cwndrws / graphHelpers.c
Created December 16, 2013 14:59
Some helper functions for building and traversing a graph in c.
#include <stdlib.h>
typedef struct Edge Edge;
typedef struct Node Node;
Edge* EdgewithNodes(Node* src, Node* dest);
Node* NodewithInfo(int i);
Node* createNodes(int i, int left);
void addEdge(Edge* src, Edge* new);
void addEdgetoNode(Node* src, Node* dest);
public void add() {
Node newNode = Node();
addChild(root, newNode);
}
public void addChild(Node parent, Node child) {
if (parent.leftChild == null) {
parent.leftChild = child;
} else if (parent.rightChild == null) {
parent.rightChild = child;
@cwndrws
cwndrws / gist:8133848
Created December 26, 2013 13:28
Program that produces error on truncate.
package main
import (
"tux21b.org/v1/gocql"
"log"
)
var cluster *gocql.ClusterConfig
func init() {
@cwndrws
cwndrws / allUsers.json
Last active January 3, 2016 06:09
fake json representation of all users in a system
[
{
"creation_date":"2008-09-08T22:47:31-07:00",
"email":"test0@fake.com",
"extra_info":{
"birthday":"1/1",
"haircolor":"brown"
},
"status":true
},
@cwndrws
cwndrws / convertJson
Last active August 29, 2015 13:56
the change I had to make to the convertJsonToJsonObject() method in the Item class.
private JsonObject convertJsonToJsonObject(String json) {
// parse json string in to JsonElement
try {
JsonElement toObject = new JsonParser().parse(json);
return toObject.getAsJsonObject();
}catch(JsonSyntaxException mfe){
return null;
// This was screwing me up a lot
}catch(IllegalStateException ise){
@cwndrws
cwndrws / uuidStringBench_test.go
Created May 21, 2014 20:16
Benchmark showing the proposed new way to stringify uuid's in gocql
package uuidStringBench
import (
"testing"
"github.com/gocql/gocql"
"fmt"
)
var (
u gocql.UUID
@cwndrws
cwndrws / Postgres
Created August 5, 2014 19:15
Postgres init script
#!/bin/sh
set -e
### BEGIN INIT INFO
# Provides: postgresql
# Required-Start: $local_fs $remote_fs $network $time
# Required-Stop: $local_fs $remote_fs $network $time
# Should-Start: $syslog
# Should-Stop: $syslog
# Default-Start: 2 3 4 5