Skip to content

Instantly share code, notes, and snippets.

View phroggyy's full-sized avatar
🔥
Building the world's best incident management platform

Leo Sjöberg phroggyy

🔥
Building the world's best incident management platform
View GitHub Profile
@Directive({
selector: '[hsThemed]',
})
export class ThemedDirective implements OnInit {
@Input() lightClass = '';
@Input() darkClass = '';
constructor(private el: ElementRef, private themingService: ThemingService) {
}
git log --pretty='format:%B' master..
| egrep -o "PROJ-[[:digit:]]{1,}"
| sort
| uniq
| xargs -I % sh -c 'curl -u $JIRA_AUTH -H "Content-Type: application/json" https://yourjira.atlassian.net/rest/api/2/issue/%'
| jq -r '[.key, .fields.issuetype.name, .fields.assignee.displayName, .fields.status.name, .fields.summary] | "\(.[0]): (\(.[1]), \(.[3])) \(.[4]) | \(.[2])"'
# output:
#
# PROJ-1234: (Story, Done) The summary of the ticket | Assignee Name
@phroggyy
phroggyy / gulp-awspublish-s3-policy.json
Last active April 25, 2017 22:16
The AWS policy required to upload files to an S3 bucket using gulp-awspublish
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"s3:ListBucket"
],
"Resource": [
"arn:aws:s3:::bucket.name"
@phroggyy
phroggyy / contract.md
Last active November 3, 2016 04:28
The contract used as a template for RL Studio's clients.

Between us, RL Studio Handelsbolag, and you, ____________________________.

Summary

We’ll always do our best to fulfil your needs and meet your expectations, but it’s important to have things written down so that we both know what’s what, who should do what and when, and what will happen if something goes wrong. In this contract you won’t find any complicated legal terms or long passages of unreadable text. We’ve no desire to trick you into signing something that you might later regret. What we do want is what’s best for both parties, now and in the future.

So in short;

You (____________________________), located at ____________________________________ are hiring us (RL Studio Handelsbolag) located at Ankdammsgatan 27, 171 67, Solna, Sweden to build a web service, outlined under Product, at an hourly rate, outlined under Payment. Of course it’s a little more complicated, but we’ll get to that.

@phroggyy
phroggyy / components_editor.js
Created July 19, 2016 06:45
A code editor in Vue
let ace = require('brace');
require('brace/mode/javascript');
require('brace/mode/scss');
require('brace/mode/html');
require('brace/theme/chrome');
require('brace/theme/twilight');
export default {
template: '<div id="ace-editor"></div>',
@phroggyy
phroggyy / MigratesElasticSearchIndices.php
Created May 19, 2016 20:42
A trait to ease the process of migrating to a new elastic search index
<?php
namespace Sparky\Domain;
use Carbon\Carbon;
use Sparky\ElasticSearchModel;
trait MigratesElasticSearchIndices
{
/**
@phroggyy
phroggyy / test-webhook.sh
Created May 3, 2016 10:44
SparkPost test relay webhook
curl -X POST -H "X-MessageSystems-Webhook-Token: TOKEN_IF_YOU_NEED_IT -H "Cache-Control: no-cache" -d '[
{
"msys": {
"relay_message": {
"rcpt_to": "[email protected]",
"friendly_from": "[email protected]",
"customer_id": "1521",
"content": {
"text": "Simple Test\r\n\r\n",
"subject": "Simple Test Please Ignore This...",
@phroggyy
phroggyy / bsocial.ex
Last active May 7, 2016 19:53
A super basic WS server
defmodule Bsocial do
use Application
def start(_type, _args) do
import Supervisor.Spec
children = [
supervisor(Task.Supervisor, [[name: Bsocial.ConnectionsSupervisor]]),
worker(Task, [Bsocial.Server, :start, [4000]])
]
@phroggyy
phroggyy / ViewServiceProvider.php
Created April 28, 2016 13:40
A tiny service provider to allow you to register views by modules
<?php
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
class ViewServiceProvider extends ServiceProvider
{
public function register()
{
@phroggyy
phroggyy / nginx.conf
Last active January 27, 2016 13:45
redirect all http requests and www.* requests to https://host.name/ Credit to @jaw-sh for the script
server {
listen 80 default_server;
listen [::]:80 default_server;
server_name _;
return 301 https://$host$request_uri;
}
server {