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
# Get my own git branches | |
keyword="$(git config user.name) refs\/heads\/" | |
git for-each-ref --format=' %(authorname) %(refname)' --sort=authorname | grep $keyword | sed "s/$(echo $keyword)//g" |
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
# Delete git branches with status [gone] (bash/zsh) | |
git branch -v | grep "\[gone\]" | awk 'END {FS="\t"}; {print $1}' | xargs git branch -D |
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
import android.support.test.rule.ActivityTestRule | |
import android.support.test.runner.AndroidJUnit4 | |
import com.myapp.MyActivity | |
import org.junit.Before | |
import org.junit.Rule | |
import org.junit.Test | |
import org.junit.runner.RunWith | |
@RunWith(AndroidJUnit4::class) | |
class MyViewModelTest { |
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 Types::PageableType < GraphQL::ObjectType | |
# Generalised pagination | |
def define_connection(**kwargs, &block) | |
this_type = self | |
super do | |
field :edges do | |
type !types[this_type] | |
resolve ->(obj, args, _ctx) { | |
page = obj.arguments[:page] || 1 |
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
<CORSRule> | |
<AllowedOrigin>http://localhost:5000</AllowedOrigin> | |
<AllowedMethod>GET</AllowedMethod> | |
<AllowedMethod>POST</AllowedMethod> | |
<AllowedMethod>PUT</AllowedMethod> | |
<AllowedHeader>*</AllowedHeader> | |
</CORSRule> |
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
import React, { Component } from 'react'; | |
const S3 = require('aws-sdk/clients/s3'); | |
const AWS = require('aws-sdk'); | |
AWS.config.update({ | |
accessKeyId: [Your AWS access key ID (from ~/.bashrc)], | |
secretAccessKey: [Your AWS secret access key (from ~/.bashrc)] | |
}); | |
class FileUpload extends Component { |