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 humps | |
def detect_case(value): | |
for case in ['snake', 'camel', 'pascal', 'kebab']: | |
if getattr(humps, f"is_{case}case")(value): | |
return case | |
return 'unknown' | |
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 humps | |
def detect_case(value): | |
for case in ['snake', 'camel', 'pascal', 'kebab']: | |
if getattr(humps, f"is_{case}case")(value): | |
return case | |
return 'unknown' | |
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/python3 | |
import requests | |
KIBANA_HOST = 'http://127.0.0.1:5601' | |
ELASTICSEARCH_HOST = 'http://127.0.0.1:9200' | |
BUILTIN_INDEX_SCHEMES = ('.kibana', '.apm') | |
def get_indices(es_host): |
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 python3 | |
# For a string containing only the letters A C G T, how would you count the occurrences | |
# of each triplet (overlapping three character substrings)? For example, in the input | |
# string "AACTGATGCTGACTGATAGTA" the characters "TGA" appear three times. | |
# | |
# AACTGATGCTGACTGATAGTA | |
# TGA: --- --- --- | |
# | |
# Produce a Python function (or class) that calculates these triplet counts, the FORMAT |
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 logging, re, os | |
import urllib.parse | |
import boto3 | |
from botocore.exceptions import ClientError | |
logger = logging.getLogger(__name__) | |
dynamodb = boto3.client('dynamodb') | |
s3 = boto3.client('s3') | |
# I just want coffee |
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 maya.cmds as cmds | |
import random | |
# Original article and code | |
# https://medium.com/take-a-bite-of-bits-and-bytes/intro-to-python-scripting-for-maya-e02ba87175b5 | |
# https://github.com/Cheryl-Lao/BitsAndBytes/blob/master/hatCreatorV1.py | |
def create(cone=None, pompom=None): | |
# create the objects | |
cone, pompom = cone or {}, pompom or {} |
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
function upto(x) { | |
console.log("print has been started!") | |
for (var i = 1; i < x; i++) { | |
console.log(i); | |
} | |
console.log("print has been finished!") | |
} |
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
source 'https://rubygems.org' | |
gem 'puma' | |
gem 'sinatra' | |
gem 'sinatra-cross_origin' | |
gem 'rack-parser' | |
gem 'rake' | |
gem 'tzinfo-data', '1.2016.5' | |
gem 'envied', '~> 0.9' |
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 sum_pairs(numbers, sum) | |
seen = Array.new | |
numbers.each do |n| | |
if seen.include?(sum - n) | |
return [sum - n, n] | |
end | |
seen << n | |
end | |
nil | |
end |
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
<body> | |
<h1> This is a HTML document </h1> | |
<div> This is my DIV</div> | |
</body> |
NewerOlder