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
#pages_controller | |
def home | |
@places = Place.all | |
@stories = Story.all | |
... | |
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/bin/python | |
import sys | |
import re | |
import time | |
from datetime import timedelta, datetime | |
now = datetime.now() | |
d_format = '%d/%b/%Y:%H:%M' | |
try: | |
back_minutes = timedelta(minutes=int(sys.argv[2])) #no more trash var | |
raw_bad_process_time = now.strftime('%d/%b/%Y:') + sys.argv[1] #gets d/m/y |
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
<?php | |
// more efficient way to do this than creating an array of all permutations indexed by each value and comparing to eachother? | |
$array = [ 'asdfasdfasdf_X', 'asdfasdfasdf_Y', '123412341234_X', 'asdfasdfasdf_Z', '123412341234_Y', 'dsfjiowefnilknml' ]; | |
$permutations = []; | |
for($i=0; $i<count($array); $i++) { | |
$key = array_shift($array); | |
$permutations[$key] = $array; |
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
/src/Controller/Api/V1/BandwidthGraphsController.php (line 52) | |
object(App\Model\Entity\BandwidthGraph) { | |
'new' => false, | |
'accessible' => [ | |
'*' => true | |
], | |
'properties' => [ | |
'id' => (int) 24, |
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/bin/rrdtool graph - \ | |
--imgformat=PNG \ | |
--start='1420076062' \ | |
--end='1420162462' \ | |
--title='EDGE-AA.atl01 - Traffic - Te1/1' \ | |
--rigid \ | |
--base='1000' \ | |
--height='120' \ | |
--width='500' \ | |
--alt-autoscale-max \ |
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
Dataset 1 [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1.5,2] | |
95th percentile 1.5 | |
Dataset 2 [200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,250,300] | |
95th percentile: 250 | |
The sum of those Datasets' 95th's would be 251.5. This is "Stacked". |
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
$array = [ | |
'0' => [ | |
'data' => [ | |
'traffic_in' => [ | |
'1', | |
'2', | |
'3', | |
'4' | |
], | |
'traffic_out' => [ |
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
<?php | |
abstract class BaseAuthenticate implements EventListenerInterface | |
{ | |
// snip.. | |
protected function _findUser($query, $username = null, $password = null) | |
{ | |
$fields = $this->_config['fields']; |
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
protected function _findUser($username, $password = null) | |
{ | |
$userModel = $this->_config['userModel']; | |
list(, $model) = pluginSplit($userModel); | |
$fields = $this->_config['fields']; | |
$conditions = [$model . '.' . $fields['username'] => $username]; | |
$scope = $this->_config['scope']; | |
if ($scope) { |
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
def web(self): | |
self.states[self.webroot_base] = { | |
'file.directory': [ | |
{'name': self.webroot_base} | |
{'mode': 750}, | |
{'owner': 'root'}, | |
{'group': 'root'} | |
] | |
} |
OlderNewer