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
/** Finding contours in binary images and approximating polylines. | |
* Implements the same algorithms as OpenCV's findContours and approxPolyDP. | |
* <p> | |
* Made possible with support from The Frank-Ratchye STUDIO For Creative Inquiry | |
* At Carnegie Mellon University. http://studioforcreativeinquiry.org/ | |
* @author Lingdong Huang | |
*/ | |
var FindContours = new function(){let that = this; | |
let N_PIXEL_NEIGHBOR = 8; |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Document</title> | |
<style> |
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
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title>example</title> | |
<meta name="viewport" content="width=device-width,initial-scale=1"> | |
<style type="text/css"> | |
.editor-a { | |
color: blue; | |
} |
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
from django.conf import settings | |
from django.contrib.auth.hashers import make_password, PBKDF2PasswordHasher | |
RAW_PASSWORD = 'my_password!' | |
settings.configure() | |
PBKDF2PasswordHasher.iterations = 10 | |
print(make_password(RAW_PASSWORD)) |
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 bash | |
# The number of branchs you want to keep | |
KEEP=100 | |
git fetch --all --prune -q | |
all_remote_branchs_num=$(git branch -r | wc -l | awk '{print $1}') | |
to_delete_remote_branchs_num=$(($all_remote_branchs_num - $KEEP)) | |
to_delete_remote_branchs=$(git for-each-ref --sort=committerdate --format="%(refname:short)" 'refs/remotes' | head -n $to_delete_remote_branchs_num ) |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<meta http-equiv="X-UA-Compatible" content="ie=edge"> | |
<title>Document</title> | |
<script> | |
function toggle() { |
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 f(arg: int) -> None: | |
pass |
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 random | |
from itertools import permutations | |
import json | |
def main(): | |
chars = [chr(i) for i in range(ord("A"), ord("Z") + 1)] | |
random.seed("ABCD") | |
keys = ["".join(pair) for pair in permutations(chars, 3)] |
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 json | |
import os | |
from redbaron import RedBaron | |
FILES_STATUS = {"FAIL": [], "SUCCESS": [], "PASS": []} | |
RESULT_OUTPUT_PATH = "~/result.json" | |
def has_chinese_char(string): |
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
# for https://github.com/graphql-python/graphene/issues/729 | |
import json | |
from graphene import ( | |
Boolean, | |
Field, | |
Interface, | |
List, | |
NonNull, |
NewerOlder