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
| Verifying that +josfaber is my blockchain ID. https://onename.com/josfaber |
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
| #!/bin/bash -e | |
| clear | |
| # requirements | |
| echo "Project folder name:" | |
| read -e projectfolder | |
| projectfolder=${projectfolder:-project} | |
| # dependencies | |
| npm init -y --prefix ./$projectfolder |
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
| alias l="ls -l" | |
| alias gf="git fetch" | |
| alias gs="git status" | |
| alias gfs="git fetch && git status" | |
| alias gi="git init && gac 'Initial commit'" | |
| alias gp="git push" # + remote & branch names | |
| alias gl="git pull" # + remote & branch names | |
| alias gpo="git push origin" # + branch name | |
| alias glo="git pull origin" # + branch name | |
| alias gpom="git push origin master" |
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
| version: '3.7' | |
| services: | |
| php-httpd: | |
| image: php:7.3-apache | |
| ports: | |
| - 80:80 | |
| volumes: | |
| - "./DocumentRoot:/var/www/html" |
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
| /** | |
| * returns the distance between two lat long coordinates | |
| * (uses degToRad and radToDeg functions below) | |
| */ | |
| function latlongdist(lat1, long1, lat2, long2) { | |
| var theta = long1 - long2; | |
| var miles = (Math.sin(degToRad(lat1)) * Math.sin(degToRad(lat2))) + (Math.cos(degToRad(lat1)) * Math.cos(degToRad(lat2)) * Math.cos(degToRad(theta))); | |
| miles = radToDeg(Math.acos(miles)) * 60 * 1.1515; | |
| var feet = miles * 5280; | |
| var yards = feet / 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
| /** | |
| * returns the number of possible combinations for given number of participants | |
| * (e.g. 6 soccer teams have to play 15 matches to have everyone playing every other once) | |
| */ | |
| function numCombinations(participants) { | |
| return 0.5 * participants * (participants-1); | |
| } |
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
| /** | |
| * return a random, unique-ish id | |
| */ | |
| function guid() { | |
| return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) { | |
| var r = Math.random()*16|0, v = c == 'x' ? r : (r&0x3|0x8); | |
| return v.toString(16); | |
| }); | |
| } |
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
| /** | |
| * return random int in range | |
| */ | |
| this.randInt = function (min, max) { | |
| return Math.floor(Math.random() * (max - min + 1)) + min; | |
| } | |
| /** | |
| * return random float in range |
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
| /** | |
| * return randomized array | |
| */ | |
| function randomized(arr) { | |
| var array = arr.slice(0); | |
| for (var i = array.length - 1; i > 0; i--) { | |
| var j = Math.floor(Math.random() * (i + 1)); | |
| var temp = array[i]; | |
| array[i] = array[j]; | |
| array[j] = temp; |
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
| /** | |
| * requestAnimationFrame polyfill | |
| * Based on: https://gist.github.com/paulirish/1579671 | |
| * Tweaked by: Bradley - https://gist.github.com/bradley | |
| */ | |
| (function() { | |
| var lastTime = 0, | |
| vendors = ['ms', 'moz', 'webkit', 'o'], | |
| x, | |
| length, |
OlderNewer