Skip to content

Instantly share code, notes, and snippets.

Avatar
😎
hack the planet

Chris Schepman cschep

😎
hack the planet
View GitHub Profile
@cschep
cschep / ddg-ios-content-blocker-proposal.md
Last active Jun 16, 2020
DDG iOS Content Blocker Proposal
View ddg-ios-content-blocker-proposal.md

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!

View rtf.js
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], '');
}
View gist:3334aeb194ce46137899451c63615093
### 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:
View gist:ceb1fc46e2e3571a208eb8c770ab2e5a
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)
View gist:d22d1fd89a88daf67e6034741e33111d
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);
}
View NSDateFormatter cheat sheet
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)
View gist:2312412
x = 0
while x < 10:
x = int(raw_input("What'll it be?"))
if x < 10:
print "It's only %d ya know." % x
else:
print "I guess it's too high now."
View gist:1294115
// Enumerate Albums
ALAssetsLibrary *library = [[ALAssetsLibrary alloc] init];
[library enumerateGroupsWithTypes:ALAssetsGroupAll
usingBlock:assetGroupEnumerator
failureBlock:assetGroupEnumberatorFailure];
[library release];
View gist:1271475
// Load Albums into assetGroups
dispatch_async(dispatch_get_main_queue(), ^
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
// Group enumerator Block
void (^assetGroupEnumerator)(struct ALAssetsGroup *, BOOL *) = ^(ALAssetsGroup *group, BOOL *stop)
{
if (group == nil)
{
View gist:a1d2ff3ecbbda4915be6
#!/bin/bash
set -e
if [ ! -f $2 ]; then
touch $2
fi
echo $1 >> $2
You can’t perform that action at this time.