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
/* | |
######### | |
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 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
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 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
// 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 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 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 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
<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 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
<!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 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
# 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 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
const getAndIgnoreFail = (fn) => { | |
return fn.catch(err => []); | |
}; | |
Promise.all([ | |
getAndIgnoreFail(axios.get('whatever')), | |
getAndIgnoreFail(axios.get('whatever2')), | |
getAndIgnoreFail(axios.get('whatever3')), | |
... | |
]).then(([whatever1, whatever2, whatever3, ...]) => { |
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
#!/bin/sh | |
# install : | |
# curl -o installer.sh https://gist.github.com/iNem0o/6346423/raw && chmod +x installer.sh && sudo ./installer.sh | |
sudo apt-get update | |
sudo apt-get --no-install-recommends -y install git cmake libusb-1.0-0-dev libpulse-dev libx11-dev screen qt4-qmake libtool autoconf automake libfftw3-dev | |
mkdir ~/src | |
echo "Installation de rtl_sdr" |
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
[demodulator] | |
# mode = "lrit" | |
mode = "hrit" | |
source = "airspy" | |
# The section below configures the sample source to use. | |
# | |
# You can leave them commented out to use the default values for the | |
# demodulator mode you choose ("lrit" or "hrit"). To use and configure | |
# any of them, uncomment the section below, and change the demodulator |