Skip to content

Instantly share code, notes, and snippets.

View nighthawk's full-sized avatar
🌊

Adrian Schönig nighthawk

🌊
View GitHub Profile
@nighthawk
nighthawk / eval_performance_test.swift
Created August 22, 2019 12:31
Highlights a potential performance issue in Eval
import XCTest
import Eval // https://github.com/tevelee/Eval
class MiniExpressionStandardLibraryTest: XCTestCase {
private func evaluate<R>(_ expression: String, inputs: [String: Any] = [:]) -> R? {
let context = Context(variables: inputs)
let interpreter = TypedInterpreter(dataTypes: MiniExpressionStandardLibrary.dataTypes, functions: MiniExpressionStandardLibrary.functions, context: context)
let result = interpreter.evaluate(expression)
@nighthawk
nighthawk / evaltest.swift
Created July 29, 2019 20:18
Eval suffix issue
import XCTest
import Eval // https://github.com/tevelee/Eval
class MiniExpressionStandardLibraryTest: XCTestCase {
private func evaluate<R>(_ expression: String, inputs: [String: Any] = [:]) -> R? {
let context = Context(variables: inputs)
let interpreter = TypedInterpreter(dataTypes: MiniExpressionStandardLibrary.dataTypes, functions: MiniExpressionStandardLibrary.functions, context: context)
let result = interpreter.evaluate(expression)
@nighthawk
nighthawk / _config.yml
Created August 16, 2017 17:53
Jekyll config for microposts
collections:
microposts:
output: true
permalink: /micro/:year/:month/:name.html
defaults:
- scope:
path: ""
type: microposts
values:
@nighthawk
nighthawk / gist:75588f5696f16149c1b7
Last active February 12, 2016 05:30 — forked from ctaloi/gist:4156185
Script to sync Pythonista App to Dropbox
import webbrowser, os, pprint
# Include the Dropbox SDK libraries
#from dropbox import client, rest, session
import dropbox
# Configuration
TOKEN_FILENAME = 'PythonistaDropbox.token'
# Get your app key and secret from the Dropbox developer website
APP_KEY = '<your dropbox app_key>'
APP_SECRET = '<your dropbox app_secret>'
@nighthawk
nighthawk / Podfile
Created August 15, 2015 08:09
Post-install hook
post_install do |installer|
# installer.pods_project.targets.each do |target| # 0.38+
installer.project.targets.each do |target| # 0.37
# https://github.com/AFNetworking/AFNetworking/issues/2321
# https://github.com/CocoaPods/CocoaPods/blob/master/CHANGELOG.md#highlighted-enhancement-that-needs-testing
# This can get removed in AFNetworking 2.6.0+
# Make sure to have 'deduplicate_targets: false' in ' ~/.cocoapods/config.yaml'
if target.name == "Pods-MYAPPNAME-AFNetworking"
target.build_configurations.each do |config|