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 | |
class Car extends Model | |
{ | |
// ... | |
public function garage() | |
{ | |
return $this->belongsTo('App\Garage'); |
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
image: php:7.3 #The docker image used for each step | |
pipelines: | |
default: | |
- step: &build-test | |
caches: | |
- composer | |
script: | |
- apt-get update && apt-get install -y unzip | |
- curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer |
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
image: php:7.3 #The docker image used for each step | |
pipelines: | |
default: | |
- step: &build-test | |
caches: | |
- composer | |
script: | |
- apt-get update && apt-get install -y unzip | |
- curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer |
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
appInsights = require("applicationinsights"); | |
let exceptionTrack = appInsights.defaultClient.trackException; | |
appInsights.defaultClient.trackException = function myExceptionTracker(telemetry) { | |
let exception = telemetry.exception | |
//How to test for a Promise | |
if (Promise.resolve(exception) == exception) { | |
exception.then(res => { | |
telemetry.exception = res; | |
exceptionTrack.call(appInsights.defaultClient, telemetry); |
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
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME | |
Code\x20H 6181 tielman 52u IPv6 0x570f09f514ea1165 0t0 TCP *:52639 (LISTEN) |
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
lsof -i:$1 | awk '{print $2}' | grep -v -e "PID" | sort -u > temp.txt | |
pids=`cat temp.txt` | |
rm temp.txt | |
echo "The ids: $pids" | |
for id in $pids; do | |
echo "killing $id"; | |
kill -9 $id; | |
done |
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
var err, result | |
[err, result] = await methodThatReturnsAPromise().then(res => [null, res], error => [error]).catch(error => {err = error}) | |
if(err != null) { | |
handleAnyExceptions(err) | |
} else if(result != null) { | |
handleResult(result) | |
} |
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
try { | |
var result = await methodThatReturnsAPromise() | |
handleResult(result) | |
} catch (err) { | |
handleAnyExceptions(err) | |
} |
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
methodThatReturnsAPromise().then(result => { | |
handleResult(result) | |
}).catch(err => { | |
handleAnyExceptions(err) | |
}) |
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
DATABASES = { | |
'default': { | |
'ENGINE': 'mysql.connector.django', | |
'NAME': '****', | |
'USER': '****', | |
'PASSWORD': '****', | |
'HOST': '****', | |
'PORT': '****', | |
'OPTIONS': { | |
"use_pure": True |
NewerOlder