Skip to content

Instantly share code, notes, and snippets.

View JTLR's full-sized avatar

Joe Taylor JTLR

View GitHub Profile
while read url; do
url=${url%$'\r'}
echo $url >> response.txt
curl --head $url >> response.txt
done <urls.txt
@JTLR
JTLR / change-remote-url
Created May 18, 2017 15:35
Change git remote URL
git remote set-url origin https://github.com/USERNAME/OTHERREPOSITORY.git
@JTLR
JTLR / containsObject.js
Created April 23, 2017 21:56
JavaScript function to check if array contains object
function containsObject(obj, list) {
for (var i = 0; i < list.length; i++) {
if (list[i] === obj) {
return true;
}
}
return false;
}
@JTLR
JTLR / round-to-decimal.js
Created April 13, 2017 07:53
Javascript round to nth decimal place
function round(value, decimals) {
return Number(Math.round(value+'e'+decimals)+'e-'+decimals);
}
@JTLR
JTLR / .bashrc
Last active May 2, 2017 09:59
bash functions and aliases for System, Git, Git LFS, NPM, Grunt, Bower and ngrok
# Functions
# -- System
local() { cd /c/xampp/htdocs ; }
# Aliases
# -- System
alias ll='ls -l'
alias ls='ls -F --color --show-control-chars'
# -- Git
@JTLR
JTLR / new_symlink.bat
Last active April 12, 2017 09:24
Create symlink
@JTLR
JTLR / get-url-paramter.php
Created April 7, 2015 13:59
Get url parameter
<?php echo htmlspecialchars($_GET["url-parameter"]); ?>
@JTLR
JTLR / .htaccess
Created October 23, 2014 17:54
Add gzip compression to .htaccess
SetOutputFilter DEFLATE
(function($) {
$.fn.closest_descendent = function(filter) {
var $found = $(),
$currentSet = this.children(); // Current place
while ($currentSet.length) {
$found = $currentSet.filter(filter);
if ($found.length) break; // At least one match: break loop
// Get all children of the current set
$currentSet = $currentSet.children();
}
@JTLR
JTLR / mini-grid.scss
Created July 7, 2014 10:14
Mini grid mixin
@mixin mini-grid($column-name, $breakpoints, $columns) {
.#{$column-name} {
float: left;
width: 100%;
}
$counter: 1;
@each $breakpoint in $breakpoints {
$column-count: nth($columns, $counter);
$column-width: unquote(100 / $column-count + '%');
@media all and (min-width: $breakpoint) {