Skip to content

Instantly share code, notes, and snippets.

Avatar
🐢
Slow Distillation ⚗️💭

elfenlaid elfenlaid

🐢
Slow Distillation ⚗️💭
View GitHub Profile
View linguistic_tagger.swift
import Foundation
let stmt: NSString = "Actionable emptiness"
let options: NSLinguisticTagger.Options = [.omitWhitespace, .omitPunctuation, .omitOther]
let stringRange = NSMakeRange(0, stmt.length)
let languageMap = ["Latn":["en"]]
stmt.enumerateLinguisticTags(in: stringRange, scheme: NSLinguisticTagScheme.lemma, options: options, orthography: nil) { tag, _, _, _ in
print(tag?.rawValue)
}
View boilerplate.swift
// Run any SwiftUI view as a Mac app.
import Cocoa
import SwiftUI
NSApplication.shared.run {
VStack {
Text("Hello, World")
.padding()
.background(Capsule().fill(Color.blue))
@elfenlaid
elfenlaid / mraid_tags.js
Created May 6, 2020
MRAID simple example
View mraid_tags.js
<script type="text/javascript">
function doReadyCheck() {
if (mraid.getState() == 'loading') {
//Wait until mraid library is ready and loaded so listen for ready event
mraid.addEventListener("ready", mraidIsReady);
}
else {
showMyAd();
}
}
View vscode-bindings.js
// Place your key bindings in this file to overwrite the defaults
[{
"key": "shift+ctrl+p",
"command": "cursorUpSelect",
"when": "editorTextFocus"
},
{
"key": "shift+ctrl+f",
"command": "cursorRightSelect",
"when": "editorTextFocus"
@elfenlaid
elfenlaid / test.json
Last active Feb 8, 2019
vscode elixir test setup
View test.json
{
"version": "2.0.0",
"tasks": [
{
"label": "mix test all",
"type": "shell",
"command": "mix",
"args": ["test", "--color", "--trace"],
"options": {
"cwd": "${workspaceRoot}",
View gist:b8335a85b76d72370545fd182969075a
git config --global alias.trim '!f() { git branch | grep -v "\*" | xargs -n 1 git branch -D; }; f'
View xcodebuild flags.md

Xcodebuild flag reference for CI:

Required flags:

-project OR -workspace

What xcode project/workspace file we're using. If you specify a project on the command-line and that project has an associated workspace, the project is still aware of its existence within the workspace. As an example, worspace level schemes will be available to xcodebuild even if you specify a project on the command line.

-scheme

Specify the scheme to use for build. Schemes specify multiple build/test targets along with environment args and command line parameters. Schemes must be marked "shared" in the xcode UI in order to be available to xcodebuild. For any particular build/test action there is a default configuration when you use a scheme from the Xcode UI.

@elfenlaid
elfenlaid / xcodebuild flags.md
Created Dec 20, 2016 — forked from mtauraso/xcodebuild flags.md
Xcodebuild flags in CI
View xcodebuild flags.md

Xcodebuild flag reference for CI:

Required flags:

-project OR -workspace

What xcode project/workspace file we're using. If you specify a project on the command-line and that project has an associated workspace, the project is still aware of its existence within the workspace. As an example, worspace level schemes will be available to xcodebuild even if you specify a project on the command line.

-scheme

Specify the scheme to use for build. Schemes specify multiple build/test targets along with environment args and command line parameters. Schemes must be marked "shared" in the xcode UI in order to be available to xcodebuild. For any particular build/test action there is a default configuration when you use a scheme from the Xcode UI.

View Bencoding.hs
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RankNTypes #-}
module Bencoding where
import Control.Applicative
import Crypto.Hash.SHA1
import Data.Attoparsec.ByteString.Char8 (Parser)
import qualified Data.Attoparsec.ByteString.Char8 as P
import Data.ByteString as B
import Data.ByteString.Char8 as BC
View gist:060f2e5840d9cc2e1a01
######################
# Options
######################
REVEAL_ARCHIVE_IN_FINDER=false
FRAMEWORK_NAME="${PROJECT_NAME}"
SIMULATOR_LIBRARY_PATH="${BUILD_DIR}/${CONFIGURATION}-iphonesimulator/${FRAMEWORK_NAME}.framework"
You can’t perform that action at this time.