View Playground.swift
import Foundation | |
import UIKit | |
import CoreText | |
// You can run this by copying this file into a Swift playground. | |
extension String { | |
// Returns the number of glyphs used to render the string. If this string | |
// should behave like a single emoji character (regardless of whether it is, |
View Playground.swift
import Foundation | |
// Each pair below is a "base" emoji copied from gemoji's emoji.json, | |
// followed by a modified emoji copied from OS X' "Emoji & Symbols" menu. | |
// You can run this by copying this file into a Swift playground. | |
// For readers' convenience, I've printed the output inline below. | |
// 1. | |
"🖐️".unicodeScalars.forEach { (c) in |
View TextDocumentProxy.swift
// | |
// documentProxy.swift | |
// KeyboardKitDemoKeyboard | |
// | |
// Created by Jeffrey Wear on 4/28/20. | |
// | |
import UIKit | |
class TextDocumentProxy<TextDocument: UIResponder & UITextInput>: NSObject, UITextDocumentProxy { |
View client.js
import _ from 'underscore'; | |
import $ from 'jquery'; | |
import Backbone from 'backbone'; | |
const DataCollection = Backbone.Collection.extend({ | |
url() { | |
return '/api/data'; | |
}, | |
fetch() { |
View main.js
import React from 'react'; | |
import ReactDOM from 'react-dom'; | |
ReactDOM.render( | |
<h1>Hello, world!</h1>, | |
document.getElementById('root') | |
); |
View actual.js
var f = ctx::ns.obj.func; | |
var g = ::ns.obj.func; | |
var h = new X::y; |
View promisify.js
function promisify(fn) { | |
return function(...args) { | |
return new Promise((resolve, reject) => { | |
fn.call(this, ...args, (err, res) => { | |
if (err) reject(err); | |
else resolve(res); | |
}); | |
}); | |
}; | |
}; |
View test.js
/* eslint no-console: false */ | |
const bluebird = require('bluebird'); | |
function isBluebirdPromise(promise) { | |
return promise.constructor === bluebird; | |
} | |
function respond() { | |
return new bluebird((resolve) => { | |
setTimeout(() => resolve('hi'), 2000); |
View link.css
[role="main"] a:not(.btn):not(.social-count):not(.reponav-item):not(.muted-link):not(.commit-tease-sha):not([data-pjax]):not(.user-mention), | |
[role="main"] .btn-link, | |
[role="main"] .numbers-summary a:hover, | |
[role="main"] table.files td.message a:hover, | |
[role="main"] .notifications .notifications-more > a { | |
color: #4078c0; | |
} | |
[role="main"] table.files td.icon .octicon-file-directory { | |
color: #80a6cd; |
View unstick.fish
# Put this in ~/.config/fish/functions/. | |
function unstick | |
kill -9 (lsof -ti :$argv[1]); and touch src/server/router.js | |
end |
NewerOlder