Skip to content

Instantly share code, notes, and snippets.

View marshall007's full-sized avatar

Marshall Cottrell marshall007

View GitHub Profile
import hashlib
salt = hashlib.sha256("salt").hexdigest()[:5]
password = "yep"
calculated_hash = hashlib.sha256(password + salt).hexdigest()
print [salt, calculated_hash]
# password: yep

Red Kap Out of Scope Updates

Static File Updates

  • Updated JS on Google Drive
  • Updated CSS on Google Drive
  • Updated templates.htm on Google Drive

PDP Innovation Switch

<!DOCTYPE html>
<!--[if lt IE 7]> <html class="no-js ie ie6 lt-ie9 lt-ie8 lt-ie7" lang="en"> <![endif]-->
<!--[if IE 7]> <html class="no-js ie ie7 lt-ie9 lt-ie8" lang="en"> <![endif]-->
<!--[if IE 8]> <html class="no-js ie ie8 lt-ie9" lang="en"> <![endif]-->
<!--[if IE 9]> <html class="no-js ie ie9" lang="en"> <![endif]-->
<!--[if gt IE 9]><!--> <html class="no-js" lang="en"> <!--<![endif]-->
<head>
$.when( t.mapTemplate, t.locations ).done( function () {
...
}
1. initial ajax call for locations
2. initial ajax call for template
3. fire another ajax call for locations
4. (1) finishes with response: { "data": "location1" }
5. (2) finishes with response: { "data": "location2" }
6. (3) finishes
@marshall007
marshall007 / gist:2424018
Created April 19, 2012 20:45
Math.limitRange function
(function() {
Math.limitRange = function(value, min, max) {
return Math.max(Math.min(value, max), min);
};
// test cases
var tests = [[50, 0, 100], // 50
[-25, 5, 15], // 5
[7, 5, 15], // 7
[19, 36, 38]]; // 36
<div id="main-description" class="row">
<div class="span5 columns">
<div id="main-slider" class="carousel slide">
<!-- Carousel items -->
<div class="carousel-inner">
<div class="item active">
<img src="http://placehold.it/470x360">
</div>
<div class="item">
<img src="http://placehold.it/470x360">
@marshall007
marshall007 / hack.sh
Last active April 19, 2024 05:27 — forked from erikh/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@marshall007
marshall007 / gist:2304699
Created April 4, 2012 18:50
[HTML] what's the most semantically-sound way of creating a header column.

CSS

table, td, th {
	border: 1px solid black;   
}

thead {
	float: left;   
}

tbody {
@marshall007
marshall007 / index.html
Created March 22, 2012 15:56
CSS3 List Bullet Test
<!DOCTYPE html>
<html>
<head>
<title>CSS3 List Bullet Demo</title>
</head>
<style>
.custom-bullets {
list-style-type: none;
}