Skip to content

Instantly share code, notes, and snippets.

View Azuka's full-sized avatar

Azuka Okuleye Azuka

View GitHub Profile
@goodwill
goodwill / cloud-sql-proxy.service
Last active July 16, 2024 21:46
Example Systemd file for starting cloud sql proxy at system start
[Install]
WantedBy=multi-user.target
[Unit]
Description=Google Cloud Compute Engine SQL Proxy
Requires=networking.service
After=networking.service
[Service]
Type=simple
@Luzifer
Luzifer / README.md
Last active May 29, 2024 08:02
Running docker-compose as a systemd service

Running docker-compose as a systemd service

Files

File Purpose
/etc/compose/docker-compose.yml Compose file describing what to deploy
/etc/systemd/system/docker-compose-reload.service Executing unit to trigger reload on docker-compose.service
/etc/systemd/system/docker-compose-reload.timer Timer unit to plan the reloads
/etc/systemd/system/docker-compose.service Service unit to start and manage docker compose
@ds300
ds300 / yarn-flat-auto.js
Created June 28, 2017 11:45
Automatically choose the latest versions of all packages when running yarn --flat
#!/usr/bin/env node
# run this before using: yarn add --dev node-pty semver
const os = require("os")
const pty = require("node-pty")
const semver = require("semver")
function semverComparator(a, b) {
if (semver.lt(a, b)) {
@asim
asim / go-istio.go
Last active October 24, 2021 03:59
micro.Service for istio
package istio
import (
"time"
"github.com/micro/go-micro"
"github.com/micro/go-micro/client"
"github.com/micro/go-micro/selector"
gcli "github.com/micro/go-plugins/client/grpc"
@JonCatmull
JonCatmull / ordinal.pipe.ts
Last active January 12, 2024 16:09
Appends ordinal (st, nd ,rd ,th) to number or turns number into ordinal. Typescript Angular2 Pipe
import { Pipe, PipeTransform } from '@angular/core';
const ordinals: string[] = ['th','st','nd','rd'];
/*
* Append ordinal to number (e.g. "1st" position)
* Usage:
* value | ordinal:keepNumber
* Example:
* {{ 23 | ordinal}}
@RDelorier
RDelorier / AccessToken.php
Created January 27, 2017 21:12
Passport jwt additional claims
<?php
namespace App\Auth;
use Laravel\Passport\Bridge\AccessToken as BaseToken;
use Lcobucci\JWT\Builder;
use Lcobucci\JWT\Signer\Key;
use Lcobucci\JWT\Signer\Rsa\Sha256;
use League\OAuth2\Server\CryptKey;
use League\OAuth2\Server\Entities\ClientEntityInterface;
@nanoninja
nanoninja / jose_jwt_go_usage.md
Created September 29, 2016 14:35
JOSE - JWT Usage Examples

JOSE - JWT Usage Examples

JOSE is a comprehensive set of JWT, JWS, and JWE libraries.

jwt.io

Installation

go get github.com/SermoDigital/jose
var cookieconsent_wrapper = function() {
console.log("I am running");
// Stop from running again, if accidently included more than once.
if (window.hasCookieConsent) return;
window.hasCookieConsent = true;
/*
Constants
*/
@pastuhov
pastuhov / AcceptanceHelper.php
Last active December 27, 2021 21:42
codeception page load wait helper
<?php
namespace tests\codeception\common\_support;
use Codeception\Exception\ModuleException;
/**
*
*/
class AcceptanceHelper extends \Codeception\Module
@cheeaun
cheeaun / color.php
Created October 2, 2009 08:30
Color class for Kohana
<?php defined('SYSPATH') or die('No direct script access.');
class Color {
public static function hex_to_rgb($hex){
$pattern = '/^#?(\w{1,2})(\w{1,2})(\w{1,2})$/';
preg_match($pattern, $hex, $matches);
$matches = array_slice($matches, 1);
if (!function_exists('map')){
function map($value){