Skip to content

Instantly share code, notes, and snippets.

Avatar

Eph Baum ephbaum

View GitHub Profile
@ephbaum
ephbaum / GerundVerbs.txt
Created April 17, 2023 05:34
A list of gerund verbs (verbs that end in -ing and function as nouns in a sentence, typically representing actions or processes)
View GerundVerbs.txt
abiding
acceding
accelerating
accepting
accomplishing
achieving
acquiring
activating
adapting
adding
@ephbaum
ephbaum / find-duplicate-lines-and-delete-vim.md
Last active April 17, 2023 05:42
A vim command that will take a list in a buffer and find & remove 1 (or more) duplicate lines
View find-duplicate-lines-and-delete-vim.md
:g/^\(.*\)\n\1$/d
  • :g: Global command to perform an action on matching lines.
  • /: Start of the pattern.
  • ^: Match the beginning of a line.
  • \(.*\): Capture any sequence of characters (using the .* pattern) between the start and end of the line. The ( ) is used for grouping the pattern.
  • \n: Match a newline character (the end of the first line and the beginning of the second line).
  • \1: Reference the first captured group (the content of the first line). This is what makes sure the two lines have the same characters.
  • $: Match the end of the second line.
@ephbaum
ephbaum / Animals.txt
Created April 17, 2023 05:03
A large list of animals
View Animals.txt
Aardvark
Abyssinian
Adelie Penguin
Affenpinscher
Afghan Hound
African Bush Elephant
African Civet
African Clawed Frog
African Forest Elephant
African Palm Civet
@ephbaum
ephbaum / laravelsail.md
Created July 16, 2022 03:52
Laravel Sail - Install Existing Project
View laravelsail.md

So you have you a little Laravel Repo and you want to use Sail. It was probably so easy to set up in the first place, but how in the hell are you planning to get this thing installed now?

You could use the composer/composer container to install composer dependencies, or you can use the laravelsail/php81-composer

docker run --rm -u "$(id -u):$(id -g)" -v $(pwd):/opt -w /opt laravelsail/php81-composer:latest composer install --ignore-platform-reqs

docker run --rm
-u "$(id -u):$(id -g)"
-v $(pwd):/opt
-w /opt \

@ephbaum
ephbaum / nationalities.php
Created September 27, 2016 00:25 — forked from zspine/nationalities.php
PHP Nationalities Array
View nationalities.php
$nationals = array(
'Afghan',
'Albanian',
'Algerian',
'American',
'Andorran',
'Angolan',
'Antiguans',
'Argentinean',
'Armenian',
@ephbaum
ephbaum / PHP Countries Array
Created September 27, 2016 00:25 — forked from DHS/PHP Countries Array
PHP array of all country names
View PHP Countries Array
<?php
$countries = array("Afghanistan", "Albania", "Algeria", "American Samoa", "Andorra", "Angola", "Anguilla", "Antarctica", "Antigua and Barbuda", "Argentina", "Armenia", "Aruba", "Australia", "Austria", "Azerbaijan", "Bahamas", "Bahrain", "Bangladesh", "Barbados", "Belarus", "Belgium", "Belize", "Benin", "Bermuda", "Bhutan", "Bolivia", "Bosnia and Herzegowina", "Botswana", "Bouvet Island", "Brazil", "British Indian Ocean Territory", "Brunei Darussalam", "Bulgaria", "Burkina Faso", "Burundi", "Cambodia", "Cameroon", "Canada", "Cape Verde", "Cayman Islands", "Central African Republic", "Chad", "Chile", "China", "Christmas Island", "Cocos (Keeling) Islands", "Colombia", "Comoros", "Congo", "Congo, the Democratic Republic of the", "Cook Islands", "Costa Rica", "Cote d'Ivoire", "Croatia (Hrvatska)", "Cuba", "Cyprus", "Czech Republic", "Denmark", "Djibouti", "Dominica", "Dominican Republic", "East Timor", "Ecuador", "Egypt", "El Salvador", "Equatorial Guinea", "Eritrea", "Estonia", "Ethiopia", "Falkland Island
View flatten-array.js
/**
* Resursively flattens an Array of depth n
*
* @param aSrc Array to be flattened
* @returns Array Single depth array
*/
var flatten = function(aSrc) {
if (Array.isArray(aSrc) && aSrc.length > 0) { // Test that paramater is both array and non-zero length
var head = aSrc[0], // Get first element from paramater
View resume.md
@ephbaum
ephbaum / click-click-click.js
Created May 5, 2015 19:49
click click click
View click-click-click.js
// test a
var $testContainer = $('.test-container'), elem = $( '<p class="test_jquery_click">Test Elem</p>' ), counterArray = [];
$testContainer.text('');
for (var i = 50; i >= 0; i--) { $testContainer.append( elem ); }
$('p.test').click( function(e) { counterArray.push($(this)); });
$('.test-container > p.test_jquery_click').each(function() {$(this).click();});
console.dir( $testContainer );
//test b
var $testContainer = $('.test-container'), elem = $( '<p class="test_jquery_trigger" onclick="$(this).trigger(\'test-click\');">Test Elem</p>' ), counterArray = [];
@ephbaum
ephbaum / complexRFX2822EmailRegExp.js
Last active August 29, 2015 14:16
complexRFX2822EmailRegExp.js
View complexRFX2822EmailRegExp.js
var complexRFX2822EmailRegExp = /(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])/;
if ( ____placeholder____.match( complexRFX2822EmailRegExp ) === null ) { return false; }
// see data @link https://regex101.com/r/oJ8nO1/1