This gist is for a comment that I made here: https://www.valentinog.com/blog/webpack-4-tutorial/
This file contains hidden or 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 lang="en"> | |
<head> | |
<title>ES6: Promises and Fetch API Example</title> | |
<meta charset="utf-8"> | |
<meta author="Conner Aiken"> | |
<meta content="width=device-width, initial-scale=1" name="viewport"> | |
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"> | |
</head> | |
<body> |
This file contains hidden or 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
document.addEventListener('contextmenu', event => event.preventDefault()); | |
// This will annoy users and some browsers prevent this behavior so test accordingly. |
This file contains hidden or 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 cleanInput($input) { | |
// Pass the $_GET, $_POST or $_REQUEST array | |
$output = array(); | |
foreach ($input as $key=>$value) { | |
$o = $value; | |
// Make sure it's within the max length | |
$o = substr($o,0,256); |
This file contains hidden or 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; |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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]%}" |
Related Setup: https://gist.github.com/hofmannsven/6814278
Related Pro Tips: https://ochronus.com/git-tips-from-the-trenches/