View common.sh
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
#!/bin/bash | |
# Begin Standard 'imports' | |
set -e | |
set -o pipefail | |
gray="\\e[37m" | |
blue="\\e[36m" | |
red="\\e[31m" |
View spacing.patch
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
--- node_modules/bulma/sass/helpers/spacing.sass 1985-10-26 04:15:00.000000000 -0400 | |
+++ patches/spacing.sass 2021-07-07 16:32:03.000000000 -0400 | |
@@ -1,8 +1,8 @@ | |
.is-marginless | |
- margin: 0 !important | |
+ margin: 0 !important | |
.is-paddingless | |
- padding: 0 !important | |
+ padding: 0 !important |
View debounce.js
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
function debounce(func, wait = 20, immediate = true) { | |
var timeout; | |
return function() { | |
var context = this, args = arguments; | |
var later = function() { | |
timeout = null; | |
if (!immediate) func.apply(context, args); | |
}; | |
var now = immediate && !timeout; | |
clearTimeout(timeout); |
View list-mysql-table-size.sql
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
SELECT TABLE_NAME, table_rows, data_length, index_length, | |
round(((data_length + index_length) / 1024 / 1024),2) "Size in MB" | |
FROM information_schema.TABLES WHERE table_schema = "schema_name" | |
ORDER BY (data_length + index_length) DESC; |
View sort.js
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
myArr.sort(function(a, b) { | |
var aName = a.text.toLowerCase(); | |
var bName = b.text.toLowerCase(); | |
return ((aName < bName) ? -1 : ((aName > bName) ? 1 : 0)); | |
}); |
View module.pattern.js
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
var myNamespace = (function () { | |
var myPrivateVar = 0; | |
var myPrivateMethod = function (someText) { | |
console.log(someText); }; | |
return { | |
myPublicVar: "foo", | |
myPublicFunction: function (bar) { | |
myPrivateVar++; | |
myPrivateMethod(bar); | |
} }; |
View linux-version.sh
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
# find out what version of Linux (distro) you are running | |
$ cat /etc/*-release | |
# find out kernel, version number, machine hardware name | |
$ uname -mrs |
View browserdetect.js
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
var BrowserDetect = { | |
init: function () { | |
this.browser = this.searchString(this.dataBrowser) || "An unknown browser"; | |
this.version = this.searchVersion(navigator.userAgent) | |
|| this.searchVersion(navigator.appVersion) | |
|| "an unknown version"; | |
this.OS = this.searchString(this.dataOS) || "an unknown OS"; | |
this.isApproved = this.searchList(this.browser, this.version); | |
if(this.OS == "iPad")document.documentElement.className += ' iOS'; |
View relativetime.php
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
function relative_time($date, $postfix = ' ago', $fallback = 'F Y') | |
{ | |
$diff = time() - strtotime($date); | |
if($diff < 60) | |
return $diff . ' second'. ($diff != 1 ? 's' : '') . $postfix; | |
$diff = round($diff/60); | |
if($diff < 60) | |
return $diff . ' minute'. ($diff != 1 ? 's' : '') . $postfix; | |
$diff = round($diff/60); | |
if($diff < 24) |
NewerOlder