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 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, |
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 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 |
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
// | |
// documentProxy.swift | |
// KeyboardKitDemoKeyboard | |
// | |
// Created by Jeffrey Wear on 4/28/20. | |
// | |
import UIKit | |
class TextDocumentProxy<TextDocument: UIResponder & UITextInput>: NSObject, UITextDocumentProxy { |
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 _ from 'underscore'; | |
import $ from 'jquery'; | |
import Backbone from 'backbone'; | |
const DataCollection = Backbone.Collection.extend({ | |
url() { | |
return '/api/data'; | |
}, | |
fetch() { |
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 React from 'react'; | |
import ReactDOM from 'react-dom'; | |
ReactDOM.render( | |
<h1>Hello, world!</h1>, | |
document.getElementById('root') | |
); |
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 f = ctx::ns.obj.func; | |
var g = ::ns.obj.func; | |
var h = new X::y; |
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
function promisify(fn) { | |
return function(...args) { | |
return new Promise((resolve, reject) => { | |
fn.call(this, ...args, (err, res) => { | |
if (err) reject(err); | |
else resolve(res); | |
}); | |
}); | |
}; | |
}; |
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
/* 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); |
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
[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; |
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
# Put this in ~/.config/fish/functions/. | |
function unstick | |
kill -9 (lsof -ti :$argv[1]); and touch src/server/router.js | |
end |
NewerOlder