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
_.contains(['name', 'type', 'mode_of_administration'], 'name') // => true |
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() { | |
$('#patient_age').on('change', function() { | |
var birth_year = moment().subtract('years', $(this).val()); | |
birth_year.startOf('year'); | |
$('#date_of_birth').val(birth_year.format('YYYY-MM-DD')); | |
}); |
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
<?xml version='1.0'?> | |
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'> | |
<fontconfig> | |
<match target="font" > | |
<edit mode="assign" name="autohint"> <bool>true</bool></edit> | |
<edit mode="assign" name="hinting"> <bool>false</bool></edit> | |
<edit mode="assign" name="lcdfilter"> <const>lcddefault</const></edit> | |
<edit mode="assign" name="hintstyle"> <const>hintslight</const></edit> | |
<edit mode="assign" name="antialias"> <bool>true</bool></edit> | |
<edit mode="assign" name="rgba"> <const>rgb</const></edit> |
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
<?php | |
class ReverseMigration_Task | |
{ | |
function __construct() | |
{ | |
$this->sql_types = array( | |
'int' => 'integer', | |
'varchar' => 'string', |
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
#include <vector> | |
#include <algorithm> | |
#include <iostream> | |
int main() | |
{ | |
std::vector<int> vec = { 1, 2, 3, 4, 5 }; | |
std::cout << "For loop, with auto" << std::endl; | |
for(auto iter = vec.begin(); iter != vec.end(); ++iter) |
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
#include <array> | |
#include <iostream> | |
using namespace std; | |
template<class T, size_t Size> | |
T sum(array<T, Size> a) | |
{ | |
T total = 0; |
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
#!/usr/bin/env bash | |
if [ $# -eq 0 ]; then | |
echo "Usage: thumbs.sh <youtube-video-id> ..." | |
exit 1 | |
fi | |
function getThumbs() { | |
for i in {0..3}; do | |
wget http://img.youtube.com/vi/"$1"/"$i".jpg -O "$1"-"$i".jpg |
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
<?php | |
$dbh = new PDO('mysql:host=localhost;dbname=injection', 'root'); | |
if(isset($_GET['id'])) { | |
// Example of injectable sql query | |
foreach($dbh->query('select * from users where id = ' . $_GET['id'] . ' LIMIT 1') as $query) { | |
$user = $query; | |
} | |
} |
OlderNewer