Skip to content

Instantly share code, notes, and snippets.

View cschep's full-sized avatar
😎
hack the planet

Chris Schepman cschep

😎
hack the planet
View GitHub Profile
#!/bin/bash
set -e
if [ ! -f $2 ]; then
touch $2
fi
echo $1 >> $2
@cschep
cschep / NSDateFormatter cheat sheet
Created December 20, 2016 03:43 — forked from romaonthego/NSDateFormatter cheat sheet
Date Formats for NSDateFormatter
a: AM/PM
A: 0~86399999 (Millisecond of Day)
c/cc: 1~7 (Day of Week)
ccc: Sun/Mon/Tue/Wed/Thu/Fri/Sat
cccc: Sunday/Monday/Tuesday/Wednesday/Thursday/Friday/Saturday
d: 1~31 (0 padded Day of Month)
D: 1~366 (0 padded Day of Year)
std::vector<long> Journal::shotDatesForCurrentMethod() {
Method *current = currentMethod(false);
std::vector<long> dates;
if (current == nullptr || current->type() != Method::MethodType::shot) {
return dates;
}
for (long date : shotDates) {
if (date >= current->startDateNum()) {
dates.push_back(date);
}
func logViewHierarchy(view: UIView) -> String {
var viewsPrinted = Set<UIView>()
var result: String = ""
func printViews(_ view: UIView, level: Int) {
guard !viewsPrinted.contains(view) else { return }
let padString = String(repeating: " | ", count: level)
result += ("\(padString) \(type(of: view))\n")
viewsPrinted.insert(view)
### Keybase proof
I hereby claim:
* I am cschep on github.
* I am cschep (https://keybase.io/cschep) on keybase.
* I have a public key whose fingerprint is B5D5 D597 6BB3 2F5D 8BDD 9A6E 799F 9DC3 6F08 829C
To claim this, I am signing this object:
@cschep
cschep / rtf.js
Last active December 11, 2019 23:41
var RTFParser = function(rtfText) {
this.rtfText = rtfText;
this.ignoreList = [];
};
RTFParser.prototype.removeIgnoredLines = function() {
var rtfText = this.rtfText;
for (var i = 0; i < this.ignoreList.length; i++) {
rtfText = rtfText.replace(this.ignoreList[i], '');
}
@cschep
cschep / ddg-ios-content-blocker-proposal.md
Last active June 16, 2020 05:01
DDG iOS Content Blocker Proposal

iOS Content Blocker Proposal

Context

There are currently two ways that DuckDuckGo can help protect an iOS user’s privacy. The first, and best, is the user downloading the DuckDuckGo Privacy Browser and using that for all of their browsing. The other way is that the user continues to user Safari (or a different third party browser) and adopts DDG as their search engine. This prevents their searches from being tracked, but once they are off to browsing they are certain to be tracked again.

Objective

I propose adding a Content Blocker Extension to the DuckDuckGo Privacy Browser App. It’s a tough sell getting users to install a whole new browser, importing their shortcuts, learning a brand new UI, etc. It’s tough enough to get them to install an app in the first place!