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; | |
} | |
} |
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
#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
#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
<?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
<?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
$(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
_.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
<?php | |
Route::secure('GET', 'patient/(:num)/prescriptions/(:num)/druglist', | |
array('as' => 'druglist-index', 'uses' => 'patient.prescriptions.druglist@index')); | |
Route::secure('POST', 'patient/(:num)/prescriptions/(:num)/druglist', | |
array('as' => 'druglist-create', 'uses' => 'patient.prescriptions.druglist@create')); | |
Route::secure('PUT', 'patient/(:num)/prescriptions/(:num)/druglist/(:num)', | |
array('as' => 'druglist-update', 'uses' => 'patient.prescriptions.druglist@update')); |
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
➜ healthie git:(site/pcs) ✗ git add . | |
warning: You ran 'git add' with neither '-A (--all)' or '--ignore-removal', | |
whose behaviour will change in Git 2.0 with respect to paths you removed. | |
Paths like 'application/migrations/2013_05_21_171759_add_missing_fields_to_prescriptions.php' that are | |
removed from your working tree are ignored with this version of Git. | |
* 'git add --ignore-removal <pathspec>', which is the current default, | |
ignores paths you removed from your working tree. | |
* 'git add --all <pathspec>' will let you also record the removals. |
NewerOlder