$ cloc
count lines of code.
Use as:
$ cloc ./
or$ cloc ./*.py
$ convert
convert .gif or .mp4 to many png frames
Use as:
$ convert -coalesce my_animatedfile.gif my_pngfiles.png
readarray -t lines < file.txt | |
count=${#lines[@]} | |
for i in "${!lines[@]}"; do | |
index=$(( (i * 12 - 1) / count + 1 )) | |
echo "${lines[i]}" >> "file${index}.txt" | |
done |
import * as THREE from 'three'; | |
// init | |
const camera = new THREE.PerspectiveCamera( 70, window.innerWidth / window.innerHeight, 0.01, 10 ); | |
camera.position.z = 1; | |
const scene = new THREE.Scene(); | |
const geometry = new THREE.BoxGeometry( 0.2, 0.2, 0.2 ); |
(function () { | |
/* | |
Copyright The Closure Library Authors. | |
SPDX-License-Identifier: Apache-2.0 | |
*/ | |
"use strict"; | |
var l; | |
function aa(a) { | |
var b = 0; |
<?php | |
/** | |
* Simple method to use the API from https://www.troyhunt.com/ive-just-launched-pwned-passwords-version-2/ | |
* Released to public domain | |
* @return int count | |
*/ | |
function checkPawnedPasswords(string $password) : int | |
{ | |
$sha1 = strtoupper(sha1($password)); | |
$data = file_get_contents('https://api.pwnedpasswords.com/range/'.substr($sha1, 0, 5)); |
import os, binascii, hashlib | |
#supply password | |
secret = 'your password here you want to use' # all you need to change! | |
#static 'count' value later referenced as "c" | |
indicator = chr(96) | |
#used to generate salt | |
rng = os.urandom |
import math | |
from moviepy.editor import concatenate, ImageClip | |
import os | |
import platform | |
import subprocess | |
import random | |
import torch | |
# pip install pytorch-pretrained-biggan | |
from pytorch_pretrained_biggan import (BigGAN, truncated_noise_sample, convert_to_images) | |
import numpy as np |
function addFieldsForItem (arrName = []) { | |
arrName.forEach(function(item) { | |
let total = 0; | |
Object.keys(item).forEach(function(key) { | |
if (typeof item[key] === 'number') { | |
total = total + item[key] | |
} | |
}) | |
item.total = total | |
}) |
“Fools ignore complexity; pragmatists suffer it; experts avoid it; geniuses remove it.”
– Alan Perlis (Turing Award #1, ALGOL)
“Computer Science is the first engineering discipline in which the complexity of the objects created is limited solely by the skill of the creator, and not by the strength of raw materials.”
FWIW: I'm not the author of the content presented here (which is an outline from Edmond Lau's book). I've just copy-pasted it from somewhere over the Internet, but I cannot remember what exactly the original source is. I was also not able to find the author's name, so I cannot give him/her the proper credits.