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
@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 / 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 / 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 / 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"
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
@Directive({
selector: '[hsThemed]',
})
export class ThemedDirective implements OnInit {
@Input() lightClass = '';
@Input() darkClass = '';
constructor(private el: ElementRef, private themingService: ThemingService) {
}
<div hsThemed
class="mt-4 p-2"
lightClass="bg-off-white"
darkClass="bg-gray-darker"></div>
</div>
.panel-splitter {
@apply .border-gray-lighter .bg-gray;
width: 8px;
border-width: 0 1px;
cursor: col-resize;
}
.panel-splitter {
width: 8px;
border-width: 0 1px;
cursor: col-resize;
&.theme--dark {
@apply .border-gray-lighter .bg-gray;
}
}
@Directive({
selector: '[hsThemed]',
})
export class ThemedDirective implements OnInit {
@Input() lightClass = '';
@Input() darkClass = '';
constructor(private el: ElementRef, private themingService: ThemingService) {
}