Skip to content

Instantly share code, notes, and snippets.

View kdawgwilk's full-sized avatar
🤓
Staff Software Engineer @ Divvy

Kaden Wilkinson kdawgwilk

🤓
Staff Software Engineer @ Divvy
View GitHub Profile
@codeasaurus
codeasaurus / README.md
Last active December 30, 2015 00:57
Utility Wrapper for managing the unruly javascript interval timer

Synopsis

Anyone that's ever tried to wrangle the native javascript interval timer has thought, "Why does this have to be so ugly and unmanageable?" MorphInterval provides a simple but flexible solution to managing javascript interval timers.

Code Example

This example shows a simple interval that calls the doSomething() function once every 60 seconds

var thisObj = this;

this.refreshInterval = new window.MorphInterval(

@andyyhope
andyyhope / SwiftEvolution_EnumCaseCountFunctionality_AndyyHope.md
Last active March 12, 2020 13:05
Swift Evolution - Enum Case Count Functionality

Swift Evolution Proposal

Author: Andyy Hope

Enum Values() Functionality (Update)

It has been brought to my attention that there was more use for the unintended values() functionality that I had outline in my "Other Languages" Java example below.

On the Swift Evolution mailing list, one developer outlined their requirement to loop through an array of enum case values to add different states to objects.

Another example where a values array would be useful if the developer wants to do something different for each different case, such as setting an image on a UIButton subclass for each different UIControlState

@kdawgwilk
kdawgwilk / cs-2420_download_txts.py
Last active December 15, 2015 09:20
CS-2420 Download Sample Student Lists
# Downloads all the sample txts to the directory where this script is ran
import urllib
files = ["InsertNames.txt", "DeleteNames.txt", "RetrieveNames.txt", "InsertNamesMedium.txt", "DeleteNamesMedium.txt",
"RetrieveNamesMedium.txt", "InsertNamesBig.txt", "DeleteNamesBig.txt", "RetrieveNamesBig.txt"]
for filename in files:
url = "http://cit.cs.dixie.edu/cs/2420/ssn/%s" % filename
file_from_url = urllib.URLopener()
file_from_url.retrieve(url, filename)
@CodaFi
CodaFi / alltheflags.md
Last active May 19, 2024 22:09
Every Option and Flag /swift (1.2) Accepts Ever

#Every Single Option Under The Sun

  • optimization level options
  • automatic crashing options
  • debug info options
  • swift internal options
  • swift debug/development internal options
  • linker-specific options
  • mode options

Git DMZ Flow

I've been asked a few times over the last few months to put together a full write-up of the Git workflow we use at RichRelevance (and at Precog before), since I have referenced it in passing quite a few times in tweets and in person. The workflow is appreciably different from GitFlow and its derivatives, and thus it brings with it a different set of tradeoffs and optimizations. To that end, it would probably be helpful to go over exactly what workflow benefits I find to be beneficial or even necessary.

  • Two developers working on independent features must never be blocked by each other
    • No code freeze! Ever! For any reason!
  • A developer must be able to base derivative work on another developer's work, without waiting for any third party
  • Two developers working on inter-dependent features (or even the same feature) must be able to do so without interference from (or interfering with) any other parties
  • Developers must be able to work on multiple features simultaneously, or at lea
@cmelchior
cmelchior / CustomTypeAdapter.java
Created April 9, 2015 06:35
Realm, GSON and primitive JSON arrays
// Make a custom Gson instance, with a custom TypeAdapter for each wrapper object.
// In this instance we only have RealmList<RealmInt> as a a wrapper for RealmList<Integer>
Type token = new TypeToken<RealmList<RealmInt>>(){}.getType();
Gson gson = new GsonBuilder()
.setExclusionStrategies(new ExclusionStrategy() {
@Override
public boolean shouldSkipField(FieldAttributes f) {
return f.getDeclaringClass().equals(RealmObject.class);
}
@omegahm
omegahm / create_labels.sh
Created April 7, 2015 19:00
Create Gtihub labels from Bash
#!/usr/bin/env bash
# Colours picked from https://robinpowered.com/blog/best-practice-system-for-organizing-and-tagging-github-issues/
###
# Label definitions
###
declare -A LABELS
# Platform
// please check https://github.com/bademux/robolectric-java-gradle-plugin instead
//build.gradle
//fixes AndroidStudion<>Robolectric integration
//fixes 'java.lang.RuntimeException: Stub!' and 'NoClassDefFoundError'
gradle.projectsEvaluated {
def imlFile = file(project.name + '.iml')
def parsedXml;
@tylerpearson
tylerpearson / copy_github_labels.rb
Last active January 11, 2022 15:27
Super simple script to copy Github tag labels from one repository to another. Uses the Octokit gem.
require 'octokit'
# https://help.github.com/articles/creating-an-access-token-for-command-line-use/
client = Octokit::Client.new(:access_token => "getmefromgithub")
COPY_FROM_REPO = "repo/old"
COPY_TO_REPO = "repo/new"
current_labels = client.labels(COPY_FROM_REPO)
@staltz
staltz / introrx.md
Last active May 24, 2024 07:56
The introduction to Reactive Programming you've been missing