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 com.bnlucas.app.config; | |
import com.codahale.metrics.MetricRegistry; | |
import com.bnlucas.components.ldap.LdapClient; | |
import com.bnlucas.app.config.liquibase.AsyncSpringLiquibase; | |
import com.bnlucas.app.domain.AppAuditorAware; | |
import com.bnlucas.springbootextras.config.Constants; | |
import com.fasterxml.jackson.datatype.hibernate4.Hibernate4Module; | |
import com.zaxxer.hikari.HikariDataSource; | |
import liquibase.integration.spring.SpringLiquibase; |
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
-------------------------------------------------------------------------------- | |
BaseHash vs Hashbrown | |
testing instantiation and hashing combined | |
base: 62 | |
length: 171 | |
value: 3154851373153015827738309232812515645550893040441169750950287100081801 | |
7098580981494840912925603132017160147302934098705114421342560722423313 |
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 time | |
import webbrowser | |
import click | |
from pymouse import PyMouse | |
from pykeyboard import PyKeyboard | |
m = PyMouse() |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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 math | |
def mceil(n, m): | |
''' | |
returns ceil(n) the multiple m. | |
example: mceil(21, 10) -> 30.0 which is the next multiple of 10. | |
:param n: value to ceil. |
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 os | |
import re | |
from subprocess import PIPE, Popen | |
import click | |
def which(executable): | |
for path in os.environ['PATH'].split(os.pathsep): |
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 os | |
def which(executable): | |
for path in os.environ['PATH'].split(os.pathsep): | |
path = path.strip('"') | |
fpath = os.path.join(path, executable) | |
if os.path.isfile(fpath) and os.access(fpath, os.X_OK): | |
return fpath |
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
''' | |
def test1(stop=100): | |
for i in range(stop): | |
pass | |
def test2(stop=100): | |
for i in xrange(stop): | |
pass | |
compare = Compare('Testing the use of range and xrange.') |
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
''' | |
Extended Euclidean Algorithm extended_gcd(a, b) methods found online. | |
''' | |
from functools import wraps | |
from time import time | |
def benchmark(iterations=10000): | |
def wrapper(function): | |
@wraps(function) |
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
def float_spec(fill, align, sign, width, separator, precision): | |
if len(fill) > 1: | |
raise ValueError('The fill character can only contain 1 character.') | |
if align not in ['left', 'right', 'center', 'padded']: | |
raise ValueError('{} is not an allowed alignment.'.format(align)) | |
if sign not in ['+', '-', ' ']: | |
raise ValueError('{} is not a valid sign.'.format(sign)) |
NewerOlder