Skip to content

Instantly share code, notes, and snippets.

View quantumJLBass's full-sized avatar

Quantum quantumJLBass

View GitHub Profile

Magento Code Snippets

@quantumJLBass
quantumJLBass / bash.md
Last active December 23, 2015 04:39
snippets for a command line bash.

General Bash snips

Test internet connectivity

#check to see if there is network connection
has_network(){
    # Capture a basic ping result to Google's primary DNS server to determine if
    # outside access is available to us. If this does not reply after 2 attempts,
    # we try one of Level3's DNS servers as well. If neither of these IPs replies to
    # a ping, then we'll skip a few things further in provisioning rather than
@quantumJLBass
quantumJLBass / gist:6858006
Last active December 24, 2015 20:29
General php snippets -- side notes, you can test things or use as scratch paper, this php code testing site http://sandbox.onlinephpfunctions.com/

Quick copy past list

####pull from editor to for quickkeying####

regex string lowwer

$str='<taxonomy alias="Abnormal dreams" name="Abnormal dreams" taxonomy_type="adverse_events" content=""/>';

$text = preg_replace_callback('/alias="(.*?)"/im',"toLower",$str);
echo $text;
function toLower($matches){
@quantumJLBass
quantumJLBass / test-mage-ext-install-list.json
Last active August 29, 2015 14:12
server_project.conf
{
"servers":{
"server2": {
"remote": {
"ip": "10.255.255.3",
"salt":{
"minion":"server_build",
"env": [
"serverbase",
"database",
[alias]
pushdoc = "!f(){ git add -A; git commit -m ${0} && git push; };f"
@quantumJLBass
quantumJLBass / Taxonomy.md
Last active December 4, 2015 21:16
Dev version (note product is repo.wsu.edu/jtrack/1/bootstrap/bootstrap.min.js and also use Google's analytics debugger to confirm function or contact **jeremy.bass at wsu.edu** for help ) ~~~ defaults listed here https://github.com/washingtonstateuniversity/jTrack/blob/dev/src/bootstrap/src/bootstrap.js#L84 ~~~

Taxonomy

This is a list of the name and values for the units by unit type.

NAME ( human readable ) VALUE ( to store in databases or use in code ) Historical names, Common names, Acronyms ( CSV initially and may be used to look up the value )
(function( window, $, WSU ){
WSU.time = null;
WSU.timer = function( time, callback){
console.log("clear old timer");
window.clearTimeout(WSU.time);
WSU.time = null;
console.log("set timer");
WSU.time = window.setInterval(function(){
console.log("do timer callback");
if( "function" === typeof callback){
var values = new[]
{
new[] { 1, 2 },
new[] { 2, 3 },
new[] { 4, 5 },
};
var flattenedUniqueValues = values.SelectMany(x => x).Distinct();//technically it handles none int too
@quantumJLBass
quantumJLBass / cloudSettings
Last active January 31, 2020 12:56
RAWdeal-VSC-settings
{"lastUpload":"2020-01-08T10:54:06.695Z","extensionVersion":"v3.4.3"}
@quantumJLBass
quantumJLBass / ZipDir.ps1
Created July 29, 2023 20:26
Zip up a directory per a .gitignore file in PS1
function Get-ZipFiles {
param (
[string]$Path = (Get-Location),
[string]$GitIgnorePath = (Join-Path -Path (Get-Location) -ChildPath ".gitignore")
)
# Read .gitignore file
$gitIgnorePatterns = Get-Content -Path $GitIgnorePath | Where-Object {