This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import BottomSheet, { | |
BottomSheetBackdrop, | |
BottomSheetBackdropProps, | |
} from "@gorhom/bottom-sheet"; | |
import { BottomSheetScrollView } from "@gorhom/bottom-sheet/src/components/bottomSheetScrollable"; | |
import { useCallback, useRef, useState } from "react"; | |
import { Button, StyleSheet, Text, View } from "react-native"; | |
const shortContents = `The most merciful thing in the world, I think, is the inability of the human mind to correlate all its contents. We live on a placid island of ignorance in the midst of black seas of infinity, and it was not meant that we should voyage far. The sciences, each straining in its own direction, have hitherto harmed us little; but some day the piecing together of dissociated knowledge will open up such terrifying vistas of reality, and of our frightful position therein, that we shall either go mad from the revelation or flee from the deadly light into the peace and safety of a new dark age.`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 1. Get a list of podcast episode mp3 files, e.g. from an RSS feed from https://feeds.megaphone.fm | |
# (just google "<your podcast> rss feed") | |
# 2. Run the get-mp3s.js script in your browser console to assemble a list of MP3 files (the url attribute of the enclosure xml tags) | |
# It's probably possible to have powershell download and parse the xml file to get the same result, but I'm just penning down the hacky method of doing it now. | |
$Urls = @() | |
$Urls += "https://example.com/podcast-episode-1.mp3" | |
# paste the rest here | |
# update this path to your destination, make sure it ends with a backslash | |
$OutPath = "C:\Users\yourname\Desktop\Destination\" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# this hook is in SCM so that it can be shared | |
# to install it, create a symbolic link in the projects .git/hooks folder | |
# | |
# i.e. - from the .git/hooks directory, run | |
# $ ln -s ../../git-hooks/pre-commit.sh pre-commit | |
# | |
# to skip the tests, run with the --no-verify argument | |
# i.e. - $ 'git commit --no-verify' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# log format base | |
lformat = log --pretty=format:'%Cred%h%Creset %C(bold blue)%an%Creset %Cgreen(%cr) %Creset-%C(yellow)%d%Creset %s' | |
# formatted, graph, branches | |
l = !git lformat --graph --branches | |
# formatted, graph current branch only | |
lb = !git lformat --graph | |
# formatted, topo-order (?) | |
lt = !git lformat --graph --branches --topo-order | |
# formatted, no pager (use with -n to show last X entries) | |
lnp = !git --no-pager l |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ObjectMapper | |
struct Test: Mappable { | |
let name: String | |
init?(_ map: Map) { | |
name = map["name"].valueOrFail() | |
if !map.isValid { | |
return nil |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var sync = Backbone.sync; | |
Backbone.sync = function(method, model, options) { | |
if (!options.error) { | |
options.error = function(method, model, options) { | |
// custom error handling here. | |
} | |
} | |
}; | |
sync(method, model, options); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Uses latest & greatest NodeJS version (0.7.5), may cause external libraries | |
like Mu to not work because of a changed package (sys was renamed to util) | |
Fix manually by going into ./node_modules/mu and replacing all instances of | |
require('sys') with require('util'). Should just run under earlier versions | |
of Node as long as you replace the below require('util') with require('sys'). | |
Download dependencies using 'npm install' | |
Run using node mock.js <port (optional)> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var util = require("util"), | |
http = require("http"), | |
url = require("url"), | |
fileSystem = require('fs'), | |
path = require('path'); | |
var responseMap = [ | |
{pattern:/\btest\?test\=true$/, response:"test-ok.xml"}, | |
{pattern:/\btest\?test=true&henk=liev$/, response:"test-ok.xml"}, | |
// 'begins with' test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
case class Trip( | |
deviceId:String, | |
plannedDeparture: DateTime, | |
fromStation: String, | |
plannedDepartureFirstStation:DateTime, | |
viaStation: Option[String], | |
toStation: String, | |
plannedArrivalLastStation: DateTime) { | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var nodeunit = require('nodeunit'); | |
exports['API'] = nodeunit.testCase({ | |
'The show() API method returns a specific thread by title and its replies by threadid': function(test) { | |
test.expect(4); | |
// our mock data | |
var posts = [{post: 'test'}, {post: 'test2'}]; | |
var thread = {_id: '1234', title: 'my thread'}; |
NewerOlder