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 | |
declare(strict_types=1); | |
namespace App\Iterator; | |
use Laminas\Mime\Part; | |
class PartsFilterIterator extends \RecursiveFilterIterator | |
{ |
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 | |
declare(strict_types=1); | |
namespace User\Entity; | |
class User | |
{ | |
private readonly int $id; | |
private readonly string $emailAddress; |
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
name: Deploy to DigitalOcean | |
on: | |
push: | |
tags: | |
- "v*.*.*" | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: |
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 | |
// File location: src/App/src/Middleware/Authorization/JWTMiddleware.php | |
declare(strict_types=1); | |
namespace App\Middleware\Authorization; | |
use DateTime; | |
use DateInterval; | |
use \Firebase\JWT\JWT; | |
use Laminas\Diactoros\Response\RedirectResponse; |
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 HelloWorld { | |
private String name; | |
public HelloWorld(String name) { | |
this.name = name; | |
} | |
public void printName() { | |
System.out.println(this.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
# Create a temporary file to store the results of the script | |
tmpfile=$(mktemp /tmp/dirnames.XXX); | |
# Print the directories found in each app directory | |
for i in $( ls . ) | |
do | |
ls -A $i >> $tmpfile | |
done | |
# Sort and print a unique list of the discovered directories |
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
FROM owncloud/ubuntu:18.04 | |
VOLUME ["/mnt/data"] | |
EXPOSE 80 | |
EXPOSE 443 | |
ENTRYPOINT ["/usr/local/bin/entrypoint"] | |
CMD ["/usr/local/bin/owncloud"] |
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
#include <stdio.h> | |
#include <time.h> | |
#include <string.h> | |
int main() | |
{ | |
time_t t = time(NULL); | |
struct tm tm = *localtime(&t); | |
const char * months[12] = {"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"}; |
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 | |
// other setup code... | |
$select | |
->where([ | |
'id = ?' => $userId | |
]) | |
->join( | |
['r' => 'tblroles'], |
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
#!/bin/bash | |
# Inspired by http://www.devthought.com/code/create-a-github-pull-request-from-the-terminal/ | |
targetbranch=master | |
if test "$1"; then | |
targetbranch=$1 | |
fi | |
repo=`git remote -v | grep -m 1 "(push)" | sed -e "s/.*github.com[:/]\(.*\)\.git.*/\1/"` |
NewerOlder