Skip to content

Instantly share code, notes, and snippets.

View keith30xi's full-sized avatar

Keith Naas keith30xi

View GitHub Profile
@keith30xi
keith30xi / GenymotionPlay.sh
Last active June 28, 2016 19:39
GenymotionPlay
#!/bin/bash
# The MIT License (MIT)
# Copyright (c) 2016 30xi, LLC
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
# The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CON
class CurrencySequencer(val currencyFormat: NumberFormat) {
private val fractionPower = Math.pow(10.0, currencyFormat.maximumFractionDigits.toDouble())
private val filler = "[^\\d]*"
private val fillerLength = filler.length
fun subsequence(text: CharSequence, start: Int, end: Int): String {
val length = text.length
val formatted = currencyFormat.format(Formats.parseDouble(text) / fractionPower)
var formattedStart = start
@keith30xi
keith30xi / download.py
Created April 8, 2020 18:20
download.py file for nacl_sdk
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import hashlib
import os
import sys
# when pylint runs the third_party module is the one from depot_tools
# pylint: disable=E0611
from third_party import fancy_urllib