View listing1.php
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; |
View deploy-to-do.yml
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: |
View JWTMiddleware.php
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; |
View HelloWorld.java
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); | |
} |
View print-ocapps-uniq-dir-names-human-readable.sh
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 |
View Dockerfile
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"] |
View complexity-example.c
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"}; |
View zend-db-sql-join-example.php
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'], |
View git-backport.sh
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/"` |
View backport-pr.sh
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 | |
set -e | |
# Script to backport a PR to branch | |
# ./backport-pr.sh backportTo backportFrom prId | |
# This script requires two other tools: | |
# - github-api-tools | |
# - git-backport | |
# add your GitHub credentials |
NewerOlder