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
var parsedUrl = 'http://10.7.215.8/ResourceCenter/small-business-banking/starting-out'.split('/'); | |
if (parsedUrl.includes('ResourceCenter') && parsedUrl.includes('small-business-banking')) { | |
console.log('true'); | |
} else { | |
console.log('false'); | |
} |
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
input = ARGF.read.split(/\n/)[1].split.map { |v| v.to_i }.sort | |
p input[-2, 2].inject { |sum, n| sum.to_i * n.to_i } |
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 (w) { | |
var referrer, | |
currentDomain, | |
domainPattern = /^(?:https?:\/\/)?(?:[^@\n]+@)?(?:www\.)?([^:\/\n]+)/im; | |
function isArrayWithLength(array) { | |
if (Array.isArray(array) && array.length === 2) { | |
return array[1]; | |
} | |
} |
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
#if ($context.httpMethod == "POST") | |
#set($rawAPIData = $input.path('$')) | |
#elseif ($context.httpMethod == "GET") | |
#set($rawAPIData = $input.params().querystring) | |
#set($rawAPIData = $rawAPIData.toString()) | |
#set($rawAPIDataLength = $rawAPIData.length() - 1) | |
#set($rawAPIData = $rawAPIData.substring(1, $rawAPIDataLength)) | |
#set($rawAPIData = $rawAPIData.replace(", ", "&")) | |
#else | |
#set($rawAPIData = "") |
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
def _find(num, list, g=0) | |
mid = list.count / 2 | |
return [num, g] if num == list[mid] | |
mid = num > mid ? list[mid..list.count] : list[0..mid - 1] | |
_find(num, mid, g += 1) | |
end | |
p _find(999, (1..999).to_a) |
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 (w, $) { | |
$(".btn.play-btn").click(); | |
w.setInterval(run, 500); | |
function clickSpan() { | |
var uniques, | |
trueUnique, | |
spanBackgrounds = []; |
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).ready(function () { | |
$('#counter_example_2').on('keyup blur paste', function (e) { | |
if ($(this).val.length > 140) { | |
return false; | |
} | |
var counter = $('#counter_2'); | |
counter.html("Remaining: " + (140 - $(this).val().length)); |
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
require 'uri' | |
require 'mechanize' | |
module Wiki | |
class Crawl | |
attr_reader :start, :domain, :mech, :exclude | |
def initialize(start) | |
@start = start |
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
commentCardP.then(function (data) { | |
console.dir(data); | |
done(); | |
}); |
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
#(apply + (for [x % | |
:let [y 1]] | |
y)) |