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 | |
| # -*- coding: utf-8 -*- | |
| from time import sleep | |
| import pyfiglet | |
| with open("pyfigletfonts.txt", "r") as file: | |
| fonts = file.read().splitlines() | |
| for fonty in fonts: |
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 genSankey(df,cat_cols=[],value_cols='',title='Sankey Diagram'): | |
| # maximum of 6 value cols -> 6 colors | |
| colorPalette = ['#4B8BBE','#306998','#FFE873','#FFD43B','#646464'] | |
| labelList = [] | |
| colorNumList = [] | |
| for catCol in cat_cols: | |
| labelListTemp = list(set(df[catCol].values)) | |
| colorNumList.append(len(labelListTemp)) | |
| labelList = labelList + labelListTemp | |
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
| /** | |
| * A linear interpolator for hex colors. | |
| * | |
| * Based on: | |
| * https://gist.github.com/rosszurowski/67f04465c424a9bc0dae | |
| * | |
| * @param {Number} a (hex color start val) | |
| * @param {Number} b (hex color end val) | |
| * @param {Number} amount (the amount to fade from a to b) | |
| * |
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 | |
| """ | |
| popm2rhythmbox | |
| Convert saved audio file rating formats | |
| ┌──────┐ ┌─────────┐ | |
| │Winamp├───►RhythmBox│ | |
| └──────┘ └─────────┘ | |
| inspired by https://github.com/shatterhand19/RhythmboxPOPM |
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 strict'; | |
| const path = require('path') | |
| const redirect = new_url => { | |
| return { | |
| status: '301', | |
| statusDescription: 'Moved Permanently', | |
| headers: { | |
| location: [{ |
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 puppeteer = require('puppeteer'); | |
| (async () => { | |
| const browser = await puppeteer.launch(); | |
| const page = await browser.newPage(); | |
| // Adjustments particular to this page to ensure we hit desktop breakpoint. | |
| page.setViewport({width: 1000, height: 600, deviceScaleFactor: 1}); | |
| await page.goto('https://www.chromestatus.com/samples', {waitUntil: 'networkidle'}); |
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
| # One liner | |
| wget --recursive --page-requisites --adjust-extension --span-hosts --convert-links --restrict-file-names=windows --domains yoursite.com --no-parent yoursite.com | |
| # Explained | |
| wget \ | |
| --recursive \ # Download the whole site. | |
| --page-requisites \ # Get all assets/elements (CSS/JS/images). | |
| --adjust-extension \ # Save files with .html on the end. | |
| --span-hosts \ # Include necessary assets from offsite as well. | |
| --convert-links \ # Update links to still work in the static version. |
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
| var DEFAULT_CELL_HEIGHT = 250; | |
| var DEFAULT_CELL_SPACING = 10; | |
| function createFullWidthMasonry(props) { | |
| var cellSpacing = props.cellSpacing || DEFAULT_CELL_SPACING; | |
| var cellHeight = props.cellHeight || DEFAULT_CELL_HEIGHT; | |
| var keyMapper = props.keyMapper || _.identity(); |
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
| <?php | |
| // AWS data | |
| $bucketName = "BUCKET-NAME"; | |
| $AWSAccessKeyId = "XXXXXXXXXXXXXXXXXXXX"; | |
| $AWSSecretAccessKey = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"; | |
| $date = date("Y-m-d"); | |
| $dateISO = date("Ymd"); | |
| $validTill = date('Y-m-d\TH:i:s.000\Z', time() + (60 * 60 * 4)); // 4 hours |
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 python | |
| import sys | |
| import tensorflow as tf | |
| import numpy as np | |
| if len(sys.argv) == 2: | |
| ckpt_fpath = sys.argv[1] | |
| else: | |
| print('Usage: python count_ckpt_param.py path-to-ckpt') |
NewerOlder