Skip to content

Instantly share code, notes, and snippets.

@ccarse
ccarse / reactions.rb
Created August 26, 2020 16:28 — forked from daybreaker/reactions.rb
Ruby script to check slack reaction counts
require 'slack-ruby-client' # first, make sure you do: gem install slack-ruby-client
require 'date'
# Add your Slack API token here
token = [YOUR TOKEN HERE]
Slack.configure do |config|
config.token = token
end

Keybase proof

I hereby claim:

  • I am ccarse on github.
  • I am ccarse (https://keybase.io/ccarse) on keybase.
  • I have a public key ASChlOIrcWj1NwePYSwYnrX5mJUmu6gfrVktV82mh9Nh6go

To claim this, I am signing this object:

@ccarse
ccarse / .block
Created September 12, 2016 16:52 — forked from mbostock/.block
Snowden’s Route
license: gpl-3.0
Pod::Spec.new do |m|
m.name = 'MapBox'
m.version = '1.0.3'
m.summary = 'Open source alternative to MapKit.'
m.description = 'Open source alternative to MapKit supporting custom tile sources, offline use, and complete cache control.'
m.homepage = 'http://mapbox.com/mobile'
m.license = 'BSD'
m.author = { 'MapBox' => '[email protected]' }

Setup and Test Mapnik iOS SDK v2.2.0

First set up a project directory to hold your work:

cd ~/projects
mkdir mapnik-ios-test
cd mapnik-ios-test
@ccarse
ccarse / patch.m
Created September 5, 2012 19:35
kvcMagic: for more than just strings....
- (void)enhancedKvcMagic:(id)object {
int columnCount = sqlite3_column_count([_statement statement]);
int columnIdx = 0;
for (columnIdx = 0; columnIdx < columnCount; columnIdx++) {
id c = [self objectForColumnIndex:columnIdx];
// check for a null row
@ccarse
ccarse / gist:3343783
Created August 13, 2012 20:11
Core data xml before
<entity name="MillHierarchy" representedClassName="MillHierarchy" syncable="YES">
<attribute name="BaseObjectID" attributeType="String" syncable="YES"/>
<attribute name="Description" optional="YES" attributeType="String" syncable="YES"/>
<attribute name="HierarchyTypeID" attributeType="String" syncable="YES"/>
<attribute name="IsActive" attributeType="Boolean" syncable="YES"/>
<attribute name="MillHierarchyID" attributeType="String" syncable="YES"/>
<attribute name="MillID" attributeType="String" syncable="YES"/>
<attribute name="Name" attributeType="String" syncable="YES"/>
<attribute name="ParentMillHierarchyID" optional="YES" attributeType="String" syncable="YES"/>
</entity>
@ccarse
ccarse / gist:3343514
Created August 13, 2012 19:36
Core Data xml
<entity name="MillHierarchy" representedClassName="MillHierarchy" syncable="YES">
<attribute name="baseObjectID" attributeType="String" syncable="YES"/>
<attribute name="description" optional="YES" attributeType="String" syncable="YES"/>
<attribute name="hierarchyTypeID" attributeType="String" syncable="YES"/>
<attribute name="isActive" attributeType="Boolean" syncable="YES"/>
<attribute name="millHierarchyID" attributeType="String" syncable="YES"/>
<attribute name="millID" attributeType="String" syncable="YES"/>
<attribute name="name" attributeType="String" syncable="YES"/>
<attribute name="parentMillHierarchyID" optional="YES" attributeType="String" syncable="YES"/>
</entity>
@ccarse
ccarse / gist:3230017
Created August 1, 2012 19:40
Obj-C new literal types example.
// Before
NSMutableDictionary *mainDict = [[NSMutableDictionary alloc] init];
[mainDict setObject:[NSDictionary dictionaryWithObjects:[NSArray arrayWithObjects:[NSDictionary dictionaryWithObjects:[NSArray arrayWithObjects:[NSNumber numberWithBool:false], serverBlob, nil]
forKeys:[NSArray arrayWithObjects:@"moreChangesAvailable", @"serverBlob", nil]], changes, nil]
forKeys:[NSArray arrayWithObjects:@"__sync", @"results", nil]]
forKey:@"d"];
// After
NSDictionary *mainDict = @{@"d":@{@"__sync":@{@"moreChangesAvailable":@0, @"serverBlob":serverBlob}, @"results":changes}};