This file contains 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
# This is just an additional file. This is an alternative for p5.js script | |
import numpy as np | |
import matplotlib.pyplot as plt | |
import matplotlib.animation as animation | |
def check_prime(num): | |
if num > 1: | |
for i in range(2,num): | |
if (num % i) == 0: |
This file contains 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
# Show Windows 10 Balloon comments | |
[void] [System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms") | |
$objNotifyIcon = New-Object System.Windows.Forms.NotifyIcon | |
while($True) | |
{ | |
$objNotifyIcon.Icon = [System.Drawing.SystemIcons]::Information | |
$objNotifyIcon.BalloonTipIcon = "Info" | |
$objNotifyIcon.BalloonTipText = "wzzup this is a title." |
This file contains 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 historic(n): | |
# Reference: https://stackoverflow.com/a/1638415/6908282 | |
def prime(i, primes): | |
for prime in primes: | |
if not (i == prime or i % prime): | |
return False | |
primes.add(i) | |
return i | |
primes = set([2]) |
If a project has to have multiple git repos (e.g. Bitbucket and Github) then it's better that they remain in sync.
Usually this would involve pushing each branch to each repo in turn, but actually Git allows pushing to multiple repos in one go.
If in doubt about what git is doing when you run these commands, just
This file contains 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
library(rayshader) | |
library(rayrender) | |
popdata = raster::raster("gpw_v4_population_density_rev11_2020_15_min.tif") | |
population_mat = rayshader:::flipud(raster_to_matrix(popdata)) | |
above1 = population_mat > 1 | |
above5 = population_mat > 5 | |
above10 = population_mat > 10 |
This file contains 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
// Copy paste this code in the browser console to add border to any answer posted by you and sort it to the top | |
function insertAfter(referenceNode, newNode) { | |
// reference: https://stackoverflow.com/a/4793630/6908282 | |
referenceNode.parentNode.insertBefore(newNode, referenceNode.nextSibling); | |
} | |
currUser = document.getElementsByClassName("s-user-card")[0]; | |
allAnswers = document.getElementsByClassName('answer'); | |
answersHeader = document.getElementById('answers-header'); |
This file contains 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
// Reference: https://stackoverflow.com/a/73790035/6908282 | |
// node convertLinks2Ref.js ReadMe.md RefLinks.md | |
import * as fs from 'fs' | |
fs.readFile(process.argv[2], 'utf8', function (err, mainMarkdown) { | |
if (err) { | |
return console.log(err); | |
} | |
let newMarkdown = existingRefLinks(mainMarkdown); |
Bash script to iterate all commits of a given Git repository and extract all files within each commit.
With a Git repository at /path/to/repository
and an empty directory at /path/to/output
we can run:
./export.sh /path/to/repository /path/to/output
OlderNewer