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
@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!

@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], '');
}
### 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:
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)
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);
}
@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)
#!/bin/bash
set -e
if [ ! -f $2 ]; then
touch $2
fi
echo $1 >> $2
" this isn't vi and apparently needs to be first?
set nocompatible
" pathogen
call pathogen#infect()
" shift O delay after insert mode? fuuuuu
set timeout timeoutlen=3000 ttimeoutlen=100
" copypaste
npm ERR! git clone --template=/Users/cschep/.npm/_git-remotes/_templates --mirror git://github.com/hackreactor-labs/utils.gulp-cardboard.git /Users/cschep/.npm/_git-remotes/git-github-com-hackreactor-labs-utils-gulp-cardboard-git-03eb0a90
npm ERR! git clone --template=/Users/cschep/.npm/_git-remotes/_templates --mirror git://github.com/hackreactor-labs/utils.pagination.git /Users/cschep/.npm/_git-remotes/git-github-com-hackreactor-labs-utils-pagination-git-9573d19e
npm ERR! git clone --template=/Users/cschep/.npm/_git-remotes/_templates --mirror git://github.com/hackreactor-labs/utils.forkchop.git /Users/cschep/.npm/_git-remotes/git-github-com-hackreactor-labs-utils-forkchop-git-abb2d4c8
npm ERR! git clone --template=/Users/cschep/.npm/_git-remotes/_templates --mirror git://github.com/hackreactor-labs/utils.gulp-problemify.git /Users/cschep/.npm/_git-remotes/git-github-com-hackreactor-labs-utils-gulp-problemify-git-2bf64c5c
npm ERR! git clone --template=/Users/cschep/.npm/_git-remotes/_templates --mirror ssh:
;;in example.migration
(defn clean-db [& [force?]]
(if-not force?
(throw (Throwable.
"This is a destructive action! Pass in `force' to make this go through"))
(let [datasource (get-db-datasource)
flyway (doto (Flyway.)
(.setDataSource datasource)
(.setSqlMigrationPrefix ""))]
(.clean flyway))))