Skip to content

Instantly share code, notes, and snippets.

@mirzap
mirzap / AccessToken.php
Created February 27, 2020 07:05 — forked from onamfc/AccessToken.php
Add Custom Claims to Passport 8 / Laravel 6
<?php
namespace App\Passport;
use App\User;
use Lcobucci\JWT\Builder;
use Lcobucci\JWT\Signer\Key;
use League\OAuth2\Server\CryptKey;
use Lcobucci\JWT\Signer\Rsa\Sha256;
use Laravel\Passport\Bridge\AccessToken as BaseToken;
# This is a sample build configuration for PHP.
# Check our guides at https://confluence.atlassian.com/x/e8YWN for more examples.
# Only use spaces to indent your .yml configuration.
# You can specify a custom docker image from Docker Hub as your build environment.
# run composer check-platform-reqs for a list of required extensions.
image: php:7.2-fpm
pipelines:
default:
# Not needed unless you're doing feature tests.
# - step:
@mirzap
mirzap / _Instructions
Created March 12, 2019 15:47 — forked from benmccallum/_Instructions.md
nuxtjs, vue-bootstrap with custom bootstrap build
1. Install bootstrap as a dev dependency, and its dependencies (node-sass and sass-loader)
`npm install --save-dev bootstrap@4.0.0-beta.2 node-sass sass-loader`
2. Install nuxt plugin of bootstrap vue (includes bootstrap-vue as a dependency)
`npm install @nuxtjs/bootstrap-vue`
3. Register plugin as module in nuxt.config.js (see below)
4. Create app.scss entry point (see below)
@mirzap
mirzap / gpg_git_signing.md
Created February 19, 2019 17:52 — forked from alopresto/gpg_git_signing.md
Steps to enable GPG signing of git commits.

If anyone is interested in setting up their system to automatically (or manually) sign their git commits with their GPG key, here are the steps:

  1. Generate and add your key to GitHub
  2. $ git config --global commit.gpgsign true ([OPTIONAL] every commit will now be signed)
  3. $ git config --global user.signingkey ABCDEF01 (where ABCDEF01 is the fingerprint of the key to use)
  4. $ git config --global alias.logs "log --show-signature" (now available as $ git logs)
  5. $ git config --global alias.cis "commit -S" (optional if global signing is false)
  6. $ echo "Some content" >> example.txt
  7. $ git add example.txt
  8. $ git cis -m "This commit is signed by a GPG key." (regular commit will work if global signing is enabled)
@mirzap
mirzap / gencert.py
Created January 26, 2019 08:02 — forked from toolness/gencert.py
Python script to create server SSL certs and sign them with a custom CA.
#! /usr/bin/python
"""
This simple script makes it easy to create server certificates
that are signed by your own Certificate Authority.
Mostly, this script just automates the workflow explained
in http://www.tc.umn.edu/~brams006/selfsign.html.
Before using this script, you'll need to create a private
@mirzap
mirzap / Ansible Let's Encrypt Nginx setup
Created December 7, 2018 15:50 — forked from mattiaslundberg/Ansible Let's Encrypt Nginx setup
Let's Encrypt Nginx setup with Ansible
Ansible playbook to setup HTTPS using Let's encrypt on nginx.
The Ansible playbook installs everything needed to serve static files from a nginx server over HTTPS.
The server pass A rating on [SSL Labs](https://www.ssllabs.com/).
To use:
1. Install [Ansible](https://www.ansible.com/)
2. Setup an Ubuntu 16.04 server accessible over ssh
3. Create `/etc/ansible/hosts` according to template below and change example.com to your domain
4. Copy the rest of the files to an empty directory (`playbook.yml` in the root of that folder and the rest in the `templates` subfolder)
@mirzap
mirzap / eval-hello.sh
Created July 12, 2018 19:42 — forked from bpo/eval-hello.sh
Redis Lua examples
redis-cli EVAL "$(cat hello.lua)" 0
@mirzap
mirzap / snarktest.solidity
Created February 24, 2018 22:26 — forked from chriseth/snarktest.solidity
zkSNARKs test code
// This file is MIT Licensed.
//
// Copyright 2017 Christian Reitwiessner
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF O
Verifying my Blockstack ID is secured with the address 1AHxBq5jqK6frnCuWoPRqwiy4hHUBbfw5Q https://explorer.blockstack.org/address/1AHxBq5jqK6frnCuWoPRqwiy4hHUBbfw5Q
@mirzap
mirzap / graphql-axios.js
Created October 23, 2017 10:28 — forked from bjunc/graphql-axios.js
application/graphql vs application/json using axios
let input = { first_name: 'Foo', last_name: 'Bar' };
// application/graphql example
/* eslint-disable no-unused-vars */
let configGraphQL = {
url: '/graphql',
method: 'post',
headers: { 'Content-Type': 'application/graphql' },
data: `mutation { user(id: 1, input: ${ JSON.stringify(input) }){ full_name } }`
};