Skip to content

Instantly share code, notes, and snippets.

View b12f's full-sized avatar
🌴

b12f b12f

🌴
View GitHub Profile
@b12f
b12f / tor-request.d.ts
Last active March 1, 2018 16:40
tor-request TypeScript d.ts file based on https://www.npmjs.com/package/tor-request#api
import * as request from 'request';
declare module 'tor-request' {
export function request(url: string, options?: request.CoreOptions, cb?: request.RequestCallback): void;
export function setTorAddress(ipaddress: string, port: number): void;
interface ITorControlPort {
password: string;
host: string;
@b12f
b12f / long-press.ts
Last active August 28, 2016 18:28
Angular 2 directive that emits a longpress event after a touch event that lasts 400ms
//<ion-item (click)="open(item)" long-press (longpress)="select(item)"></ion-item>
import {Directive, HostListener, Output, EventEmitter} from '@angular/core';
@Directive({
selector: '[long-press]'
})
export class LongPressDirective {
private touchTimeout: any;
@Output() longpress = new EventEmitter();