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
public function getSalesmanTerritory() | |
{ | |
return | |
$this->salesman->fname . | |
' ' . | |
$this->salesman->lname . | |
' ' . | |
$this->territory->name; | |
} |
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
function runBenchMark($method, $runs){ | |
$time_start = microtime(true); | |
for( $i=0; $i <= $runs; $i++){ | |
$method(); | |
} | |
$time_end = microtime(true); | |
return (float)($time_end - $time_start); | |
} | |
function benchMark($method1, $method2, $runs){ |
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
class Query | |
{ | |
private $haystack; | |
private $matches; | |
public function handle($class, $find='') | |
{ | |
$this->getHaystack($class); |
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
@section('js') | |
<script> | |
window.category = '{{ $category }}'; | |
</script> | |
@endsection |
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
sudo cp /etc/samba/smb.conf{,.backup} |
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
#!/usr/local/bin/python3 | |
import os | |
class ActiveSite: | |
def __init__(self, dbg=False): | |
self.debug = dbg | |
self.apiLocation = '<oldapilocation>' | |
self.newApiLocation = '<newapilocation>' |
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
namespace :db do | |
desc "load data from csv" | |
task :load_csv_data => :environment do | |
require 'fastercsv' | |
FasterCSV.foreach("importdata/tarife.csv", :headers => true, :col_sep => ',') do |row| | |
Anbieter.find_or_create_by_name( | |
:name => row['Anbieter_Name'] | |
:hotline => row['Hotline'], | |
:email => row['Email'] |