Here are some resources to help us write better code and recognize code that may need some help.
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
{ | |
"color_scheme": "Packages/Ciapre Color Scheme/CiapreBlack.tmTheme", | |
"draw_white_space": "all", | |
"ensure_newline_at_eof_on_save": true, | |
"font_size": 19.0, | |
"ignored_packages": | |
[ | |
"JSLint", | |
"Vintage", | |
"BracketHighlighter" |
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
<form id="theform" class="pure-form pure-form-stacked"> | |
<fieldset> | |
<label for="name"> | |
Name: | |
<input type="text" id="name" placeholder="Full Name"/> | |
</label> | |
<label for="address1"> | |
Address: | |
<input type="text" id="address" placeholder="House Number, Street" /> | |
</label> |
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
$.ajax({ | |
type: "GET", | |
beforeSend: function(request) { | |
request.setRequestHeader("x-referrer", "<your domain here. example.com>"); | |
request.setRequestHeader("x-key", "<your api key here>"); | |
}, | |
url: "https://zip.getziptastic.com/v3/US/48867", | |
success: function(data) { | |
console.log(data); | |
} |
This is a simple way to indicate the best times for a client to contact you via a given medium. This could be used for chat, twitter, skype etc...
TODO: Add in timezone support.
A Pen by Thomas Schultz on CodePen.
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
<html> | |
<body> | |
<form action="/next_page.php" method="get"> | |
Postal Code: <input type="text" name="postalcode"> | |
<input type="submit"> | |
</form> | |
</body> | |
</html> |
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 | |
$opts = array( | |
'http'=>array( | |
'method'=>"GET", | |
'header'=>"x-referrer: " . $_SERVER['HTTP_REFERER'] . " \r\n" | |
) | |
); | |
$postal_code = strip_tags(htmlspecialchars($_POST['postalcode'], ENT_QUOTES)); |
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
var gulp = require('gulp'); | |
var sass = require('gulp-sass'); | |
var concat = require('gulp-concat'); | |
gulp.task('sass', function () { | |
gulp.src(['./css/theme.scss']) | |
.pipe(sass().on('error', sass.logError)) | |
.pipe(concat('theme.css')) | |
.pipe(gulp.dest('./css/compiled/')); | |
}); |
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
from math import log | |
def to_decimal(n, base): | |
if n < 10: | |
return n | |
p = int(log(n, 10)) | |
msb = base ** p | |
n -= 10 ** p |
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
import os | |
import logging | |
def generate_primes(number): | |
logger = logging.getLogger(str(os.getpid()) + ':logger') | |
for num in range(number + 1): | |
# prime numbers are greater than 1 | |
if num > 1: |
OlderNewer