Skip to content

Instantly share code, notes, and snippets.

View jericrealubit's full-sized avatar
🎯
Focusing

jeric realubit jericrealubit

🎯
Focusing
View GitHub Profile
@jericrealubit
jericrealubit / chkASCII32_126.js
Created March 22, 2018 20:29
Validate an input string if it is inside ASCII 32 - 126 range
/**
* Validate an input string if it is inside ASCII 32 - 126 range
* @param string
* @return true if all characters in the string are in range, else false
*/
var chkASCII32_126 = function(string) {
return !string.match(/[^\x20-\x7e]/g);
}
$(".chorusASCIIValidation").keyup(function() {
@prog
prog / .gitlab-ci.yml
Created December 14, 2017 07:30
How to use composer (php) including cache with gitlab-ci
build:install-vendor:
stage: build
image: <any-image-with-composer>
before_script:
- composer config -g cache-dir "$(pwd)/.composer-cache"
script:
- composer install --ignore-platform-reqs --no-dev --optimize-autoloader --no-ansi --no-interaction --no-progress
cache:
paths:
- .composer-cache/
@sudomabider
sudomabider / questions.md
Last active November 9, 2017 23:59
Interesting coding questions

What will it be?

Javascript

// Without running these in the browser, can you tell what each of the following would return?
['1', '2', '3', '4'].map(parseInt);

(new Array(2)).map(function() {
 return 1;
@andyrbell
andyrbell / docker-image-size.sh
Last active June 3, 2024 16:58
Sort docker images by size desc
#!/bin/sh
docker images --format '{{.Size}}\t{{.Repository}}\t{{.Tag}}\t{{.ID}}' | sed 's/ //' | sort -h -r | column -t
@nasrulhazim
nasrulhazim / readme.md
Last active June 2, 2021 19:42
Send Welcome Email Notification with Event and Listener

Send Welcome Email Notification with Event and Listener

Step 1

Create SendWelcomeEmailNotification notification

php artisan make:notification SendWelcomeEmailNotification
@sdieunidou
sdieunidou / rabbitmq.txt
Created October 22, 2015 19:51
create admin user on rabbitmq
rabbitmqctl add_user test test
rabbitmqctl set_user_tags test administrator
rabbitmqctl set_permissions -p / test ".*" ".*" ".*"
@PurpleBooth
PurpleBooth / README-Template.md
Last active November 13, 2024 22:21
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@yangshun
yangshun / arrayToCSV.js
Last active January 18, 2021 15:22
Converts a 2D array into a CSV file
function arrayToCSV (twoDiArray) {
// Modified from: http://stackoverflow.com/questions/17836273/
// export-javascript-data-to-csv-file-without-server-interaction
var csvRows = [];
for (var i = 0; i < twoDiArray.length; ++i) {
for (var j = 0; j < twoDiArray[i].length; ++j) {
twoDiArray[i][j] = '\"' + twoDiArray[i][j] + '\"'; // Handle elements that contain commas
}
csvRows.push(twoDiArray[i].join(','));
}
@kfl62
kfl62 / do_not_log.conf
Created July 21, 2013 16:43
nginx configuration file, (do not log robots.txt and favicon.ico requests)
# Designed to be included in any server {} block.
location = /favicon.ico {
log_not_found off;
access_log off;
}
location = /robots.txt {
allow all;
log_not_found off;
access_log off;
@piscis
piscis / gist:1466115
Created December 12, 2011 09:14
Match ASCII chars via RegularExpression in Javascript
/**
* Small regular expression to match ASCII-chars between 32-126
*
* For a conversion table for ASCII chars see:
* http://de.wikipedia.org/wiki/American_Standard_Code_for_Information_Interchange
*/
var expr = /([\x20-\x7E]{1,})/gi;
var testString = "Foo Bar Barz";
var testString2 = "Foo Bar\tBarz";