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
# This configuration file is provided on an "as is" basis, | |
# with no warranties or representations, and any use of it | |
# is at the user's own risk. | |
# | |
# You will need to edit domain name information, IP addresses for | |
# redirection (at the bottom), SSL certificate and key paths, and | |
# the "Public-Key-Pins" header. Search for any instance of "TODO". | |
user www-data; | |
worker_processes 4; |
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
<!doctype html> | |
<html> | |
<head> | |
<title> Learn to Code Securely – Code Example </title> | |
<style> | |
div#mp3_player { | |
width: 500px; | |
height: 60px; | |
background: #000; |
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
<div class="sidebar"> | |
<a id="button1" class="button"> | |
<div class="text-center"> | |
<i class="show-for-large-up fi-page-add icon-36"></i> | |
<p>Button 1 Button 1 Button 1</p> | |
</div> | |
</a> | |
<a id="button2" class="button"> | |
<div class="text-center"> | |
<i class="show-for-large-up fi-page-edit icon-36"></i> |
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 e = ['5+3','9+1','8+6','4+4','7+3'];e.forEach(function(eq){v=eq.split('+');a=parseInt(v[0])+parseInt(v[1]);b=parseInt(v[0])*parseInt(v[1]);console.log(b.toString()+a.toString())}) I put |
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
// simpler, faster, version that will throw a TypeError if the path is invalid | |
// by yorick | |
function extract(obj, key){ | |
return key.split('.').reduce(function(p, c) {return p[c]}, obj) | |
} | |
extract | |
// for example: |
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
app.directive('ngFocus', ['$parse', function($parse) { | |
return function(scope, element, attr) { | |
var fn = $parse(attr['ngFocus']); | |
element.bind('focus', function(event) { | |
scope.$apply(function() { | |
fn(scope, {$event:event}); | |
}); | |
}); | |
} | |
}]); |
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
/* | |
######### | |
Notes: | |
######### | |
- $scope.saleschart is the chart object passed to the directive. | |
- $scope.saleschart.data is and instance of google.visualization.DataTable, giving it access to that class's member functions. | |
I also discovered that being an instance of the Chart API class allows access to the functions, but results in and field or | |
property being obfuscated. Calling .toJSON() gives a JSON object of the DataTable, which helps in debugging... but I just | |
don't trust any names other than functions. | |
- $scope.saleschart.view.columns starts as an array like [0,1,2,3,4,5]. Having fewer values than the number of columns would |
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
.col-xs-15, | |
.col-sm-15, | |
.col-md-15, | |
.col-lg-15 { | |
position: relative; | |
min-height: 1px; | |
padding-right: 10px; | |
padding-left: 10px; | |
} |
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
// This code uses the SoftwareSerial library. | |
// It can be obtained here: http://arduino.cc/en/Reference/SoftwareSerial | |
unsigned int timeout=0; | |
unsigned char state=0; | |
char val; // variable to receive data from the serial port | |
int ledpin = 13; // LED connected to pin 13 | |
// Timer2 service |
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
# | |
# Wide-open CORS config for nginx | |
# | |
location / { | |
if ($request_method = 'OPTIONS') { | |
add_header 'Access-Control-Allow-Origin' '*'; | |
# |