This file contains hidden or 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
| export class LinkedList { | |
| constructor () { | |
| this._first = null | |
| this._last = null | |
| this.length = 0 | |
| } | |
| push (item) { | |
| let value = { | |
| prev: null, |
This file contains hidden or 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
| #!/usr/bin/env node | |
| /* | |
| Simple script to download galleries from exhentai.org w/out GPs, H@H or torrents | |
| Requires node >= 10 to run (uses fs.promises) | |
| Dependencies: | |
| yarn add cheerio node-fetch mime-types | |
| # or | |
| npm install cheerio node-fetch mime-types |
This file contains hidden or 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 { Context } from 'koa' | |
| function isPojo (obj: any): boolean { | |
| return obj && typeof obj === 'object' && obj.constructor === Object | |
| } | |
| export interface SseController { | |
| emit (options?: SseEmitOptions): void | |
| close (): void |
This file contains hidden or 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
| // This file is licensed under LGPLv3 | |
| // (c) teidesu 2020 | |
| class Decoder { | |
| pos = 0 | |
| constructor (str) { | |
| this.str = str | |
| } | |
| decode () { |
This file contains hidden or 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
| // This file is licensed under LGPLv3 | |
| // (c) teidesu 2020 | |
| const alphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567' | |
| const padLength = [0, 1, 3, 4, 6] | |
| const padChar = '=' | |
| function encode (buf) { | |
| let arr = [...buf] | |
| let len = arr.length | |
| let ret = '' |
This file contains hidden or 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
| // This file is licensed under LGPLv3 | |
| // (c) teidesu 2020 | |
| const qs = require('querystring') | |
| const crypto = require('crypto') | |
| // https://gist.github.com/teidesu/a1eadf71ffd88166415e2ea8b94d3f3b | |
| const bencode = require('./bencode') | |
| function convert (file) { | |
| const data = bencode.decode(f) |
This file contains hidden or 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
| /** | |
| * Similar to Promise.race(), but resolves once one of the promises | |
| * resolve to a successful value and didn't throw error. | |
| * A promise result is considered `successful` when | |
| * check(result) resolves to a truthy value. | |
| * | |
| * When all promises resulted with unsuccessful values, `null` is returned, | |
| * otherwise result of first successful one is returned | |
| * |
This file contains hidden or 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
| package desu.player.views; | |
| import android.content.Context; | |
| import android.graphics.Canvas; | |
| import android.graphics.Color; | |
| import android.graphics.Paint; | |
| import android.view.View; | |
| import android.view.animation.AccelerateDecelerateInterpolator; | |
| import android.view.animation.Interpolator; |
This file contains hidden or 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
| /** | |
| * Emoji sprite and data generator. | |
| * | |
| * Data is taken from frankerfacez.com and name->char index is generated. | |
| * | |
| * Sprite generator works by parsing some of the code in DrKLO/Telegram (Telegram for Android) | |
| * and downloading emoji files contained there, while generating code and sprite. | |
| * | |
| * Can easily be modified to generate JSON instead of CSS or to download from some other source. | |
| * Can also be easily ported to TypeScript |
This file contains hidden or 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
| const prefix = 'prefix_' | |
| const rawLS = window.localStorage | |
| const wrappedLS = new Proxy(rawLS, { | |
| get(target, prop, receiver) { | |
| if (typeof target[prop] === 'function') { | |
| return function(key, value) { | |
| return target[prop](prefix + key, value) | |
| } | |
| } |