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
<?php | |
// This script compares regex validation vs php validation speeds for a sample JSON data set | |
// ================================= | |
// Fetch some sample data | |
// =-=-=-=-=-=-=-=-=-=-=-=- | |
$ch = curl_init(); | |
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); |
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 | |
# Install common dependency | |
sudo apt install python-software-properties | |
# Add Ondřej Surý PPA | |
sudo add-apt-repository ppa:ondrej/php | |
# Update apt |
Related Setup: https://gist.github.com/hofmannsven/6814278
Related Pro Tips: https://ochronus.com/git-tips-from-the-trenches/
This gist is for a comment that I made here: https://www.valentinog.com/blog/webpack-4-tutorial/
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
GNU nano 2.5.3 File: /home/connera/.oh-my-zsh/themes/robbyrussell.zsh-theme Modified | |
local ret_status="%(?:%{$fg_bold[green]%}➜ :%{$fg_bold[red]%}➜ )" | |
PROMPT='${ret_status} %{$fg[cyan]%}%c%{$reset_color%} $(git_prompt_info)' | |
# Customize and add user/host perfix | |
PROMPT="%{$fg[white]%}%n@%{$fg[green]%}%m%{$reset_color%} ${PROMPT}" | |
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[blue]%}git:(%{$fg[red]%}" |
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 | |
# REPO_NAME=<repo>.git | |
# ORIGIN_URL=git@<host>:<project>/$REPO_NAME | |
# REPO1_URL=git@<host>:<project>/$REPO_NAME | |
rm -rf $REPO_NAME | |
git clone --bare $ORIGIN_URL | |
cd $REPO_NAME | |
git remote add --mirror=fetch repo1 $REPO1_URL |
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
// change this variable to match the name of the job whose builds you want to delete | |
def jobName = "Your Job Name" | |
def job = Jenkins.instance.getItem(jobName) | |
job.getBuilds().each { it.delete() } | |
// uncomment these lines to reset the build number to 1: | |
//job.nextBuildNumber = 1 | |
//job.save() |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<script> | |
const validUrl = 'https://jsonplaceholder.typicode.com/posts'; | |
const invalidUrl = 'https://jsonplaceholder.invalid.domain.com/posts'; | |
function downloadData(url) { | |
console.log(`[downloadData()] attempting AJAX request to ${url}`); |
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
// Export to CSV function | |
DBQuery.prototype.toCSV = function(deliminator, textQualifier) | |
{ | |
var count = -1; | |
var headers = []; | |
var data = {}; | |
var cursor = this; | |
deliminator = deliminator == null ? ',' : deliminator; |
NewerOlder