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
// Usage: node ./apply-all-import-fixes.js ./path/to/index.ts | |
import * as ts from "typescript/lib/tsserverlibrary"; | |
import * as fs from "fs"; | |
import * as path from "path"; | |
class Logger implements ts.server.Logger { // tslint:disable-line no-unnecessary-qualifier | |
private fd = -1; | |
private seq = 0; | |
private inGroup = false; | |
private firstInGroup = true; |
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
--[[ | |
Method missing should be an optional definition on any object. | |
If a method cannot be found, method_missing is called if available | |
]] | |
local field = '__method__missing' | |
function method_missing(selfs, func) | |
local meta = getmetatable(selfs) |
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 catmullRom = function(p0, p1, p2, p3, distance) { | |
var points = [p0, p1, p2, p3], | |
t = function(dest) { | |
if (dest === 0) return 0; | |
return Math.pow( | |
Math.sqrt( | |
Math.pow(points[dest].x - points[dest-1].x,2) + Math.pow(points[dest].y - points[dest-1].y,2) + Math.pow(points[dest].z - points[dest-1].z,2) | |
), 0.5) + t(dest-1); | |
}, | |
t0 = t(0), |
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
interface Obj<T> { | |
ref: T; | |
} | |
interface Func<T> { | |
(x: T): void; | |
} | |
type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends ((k: infer I) => void) ? I : never; | |
type CtorOf<T> = (arg: UnionToIntersection<T>) => T; | |
interface Big { |
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
interface Obj<T> { | |
ref: T; | |
} | |
interface Func<T> { | |
(x: T): void; | |
} | |
type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends ((k: infer I) => void) ? I : never; | |
type CtorOf<T> = (arg: UnionToIntersection<T>) => T; | |
interface Big { |
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
interface Obj<T> { | |
ref: T; | |
} | |
interface Func<T> { | |
(x: T): void; | |
} | |
type CtorOf<T> = T extends unknown ? (x: T) => T : never; | |
interface Big { | |
"0": { common?: string; "0"?: number, ref?: Obj<Big["0"]> | Func<Big["0"]>; } |
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
# Install so many prerequisite libraries: | |
sudo yum groupinstall "Development tools" | |
sudo yum install openssl-devel git qt-devel boost boost-devel libsndfile-devel avahi avahi-compat-libdns_sd avahi-compat-libdns_sd-devel protobuf-compiler protobuf-devel gettext gettext-devel festival libtool-ltdl-devel libffi-devel pcre-devel readline-devel automake libtool gtk-devel intltool dotconf speech-dispatcher speech-dispatcher-devel alsa-lib-devel libdaemon-devel libusb-devel libtool rpm-build | |
# Clone the client’s source: | |
cd ~ | |
git clone https://github.com/mumble-voip/mumble.git | |
cd mumble | |
# Checkout a stable revision: | |
git checkout 1.2.x | |
# Build the makefile: |
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
{ | |
"version": "0.2.0", | |
"configurations": [ | |
{ | |
"name": "Launch", | |
"type": "node", | |
"request": "launch", | |
"program": "${workspaceRoot}/node_modules/gulp/bin/gulp.js", | |
"stopOnEntry": true, | |
"args": ["test"], |
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(window) { | |
//Step 1: Promised wrapper for XMLHTTPRequest | |
function Request(url, options) { | |
return new Promise(function(resolve, reject) { | |
if (!options) { | |
if (typeof(url) == "string") { | |
options = { url: url }; | |
} else { |
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
local socket = require("socket") | |
local http = require("socket.http") | |
--Safety is overrated. Pull scripts form the web! | |
local function webclude(target, ...) | |
local body, status, res_head, res_stat = http.request(target, ...) | |
if body then | |
return body |
NewerOlder