Skip to content

Instantly share code, notes, and snippets.

View sl's full-sized avatar

Sam Lazarus sl

View GitHub Profile

Keybase proof

I hereby claim:

  • I am sl on github.
  • I am slazarus (https://keybase.io/slazarus) on keybase.
  • I have a public key whose fingerprint is BF48 D5CB 8F19 A5F6 7AA0 1EB5 47CE 0A4B 04A9 E1F2

To claim this, I am signing this object:

config defaultToCurrentScreen true
# Abstract positions
alias full move screenOriginX;screenOriginY screenSizeX;screenSizeY
alias lefthalf move screenOriginX;screenOriginY screenSizeX/2;screenSizeY
alias righthalf move screenOriginX+screenSizeX/2;screenOriginY screenSizeX/2;screenSizeY
alias tophalf move screenOriginX;screenOriginY screenSizeX;screenSizeY/2
alias bottomhalf move screenOriginX;screenOriginY+screenSizeY/2 screenSizeX;screenSizeY/2
alias topleft corner top-left resize:screenSizeX/2;screenSizeY/2
alias topright corner top-right resize:screenSizeX/2;screenSizeY/2
@sl
sl / asyncawaitsort.js
Created August 14, 2017 19:07
Asyncawait Sort
// don't worry about it... it just works
function delay(ms){
var ctr, rej, p = new Promise(function (resolve, reject) {
ctr = setTimeout(() => resolve(ms), ms);
rej = reject;
});
p.cancel = function(){ clearTimeout(ctr); rej(Error("Cancelled"))};
return p;
}
@sl
sl / settings.json
Created April 28, 2019 00:58
[Swift Complier Environment Configuration] File Associations
"files.associations": {
"*.swift.result": "swift",
"*.swift.gyb": "swift",
"*.gyb": "swift",
"*.cpp.gyb": "cpp",
}
@sl
sl / install_headers.bash
Created April 28, 2019 01:08
[Swift Complier Environment Configuration] Install macOS SDK headers
sudo installer -pkg /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg -target /
@sl
sl / clang_include_results.bash
Last active April 28, 2019 01:25
[Swift Complier Environment Configuration] Clang include results
clang -cc1 version 8.0.0 based upon LLVM 8.0.0 default target x86_64-apple-darwin18.2.0
ignoring nonexistent directory "/usr/include/c++/v1"
ignoring nonexistent directory "/usr/include"
#include "..." search starts here:
#include <...> search starts here:
/usr/local/opt/llvm/bin/../include/c++/v1
/usr/local/include
/usr/local/Cellar/llvm/8.0.0/lib/clang/8.0.0/include
/System/Library/Frameworks (framework directory)
/Library/Frameworks (framework directory)
@sl
sl / c_cpp_properties.js
Last active April 28, 2019 03:19
[Swift Complier Environment Configuration] C/C++ Configuration
"includePath": [
// the include folder under your build directory
"${workspaceFolder}/../build/Ninja-RelWithDebInfoAssert+swift-DebugAssert/swift-macosx-x86_64/include",
"${workspaceFolder}/../build/Ninja-RelWithDebInfoAssert+swift-DebugAssert/llvm-macosx-x86_64/include/**",
// the include folder for clang
"${workspaceFolder}/../clang/include",
// all the files in the project
"${workspaceFolder}/**",
// all files under the llvm include folder
"${workspaceFolder}/../llvm/include/**",
@sl
sl / c_cpp_properties.js
Last active April 28, 2019 03:07
[Swift Complier Environment Configuration] Framework inclusions
"compilerPath": "${workspaceFolder}/../build/Ninja-RelWithDebInfoAssert+swift-DebugAssert/llvm-macosx-x86_64/bin/clang",
"cppStandard": "c++17",
"intelliSenseMode": "clang-x64"
// if you're on a mac
"macFrameworkPath": [
"/System/Library/Frameworks",
"/Library/Frameworks"
],
@sl
sl / launch.json
Created April 28, 2019 01:43
[Swift Complier Environment Configuration] Debug Launch
{
"version": "0.2.0",
"configurations": [
{
"type": "lldb",
"request": "launch",
"name": "Debug",
"program": "${env:SWIFT_BUILD_DIR}/bin/swift",
"args": ["${input:testFile}"],
"cwd": "${env:SWIFT_EXAMPLES_DIR}",
@sl
sl / tasks.json
Created April 28, 2019 01:58
[Swift Complier Environment Configuration] Format Task
{
"label": "Format changes",
"type": "shell",
"command": "git",
"args": [
"clang-format",
"master"
]
}