Skip to content

Instantly share code, notes, and snippets.

@yakup
yakup / git_aliases.txt
Created June 25, 2018 13:46
Git aliases
alias.co checkout
alias.st status
alias.ec config --global -e
alias.br branch -vv
alias.gr grep -i
alias.ls !git branch -r && git br
alias.up !git pull --rebase --prune $@ && git submodule update --init --recursive
alias.cob checkout origin/HEAD -b
alias.rn !f(){ git branch -m ${1}; };f
alias.task !f(){ git checkout -b t${1}/${2}/${3} origin/HEAD && git status; };f
@yakup
yakup / Sublime Text 3 Command
Created January 9, 2019 08:30 — forked from vanderlin/Sublime Text 3 Command
Create a Sublime Text 3 symbolic link to open a file via command line. paste this into terminal and now you can run `subl .` to open the directory in sublime or `subl file.html`
ln -s /Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl /usr/local/bin/subl
const puppeteer = require('puppeteer');
const { defineSupportCode } = require('cucumber')
defineSupportCode(({ Before, Given, When, Then }) => {
Before({ timeout: 60 * 1000 }, async function testCase() {
this.browser = await puppeteer.launch()
})
Given('I am on google with puppeteer', { timeout: 60 * 1000 }, async function testCase() {
this.page = await this.browser.newPage()
# uses xpath to check for a form element based on the label,
# instead of using a css selector w/ label_for
# name should be the complete name in the html page.
# meaning Title: and not Title
# find the label that is name. Get the "for" of the label
# uses the for to check for the input with that as an id
Then /^I should see a "([^\"]*)" for "([^\"]*)"$/ do |type, name|
case type
# some aliases
alias ll='ls -alF'
alias la='ls -A'
alias eb="sudo nano ~/.bash_profile && source ~/.bash_profile"
#docker aliases
alias d='docker'
alias dc='docker-compose'
alias dnax="docker rm $(docker ps -aq)"
#git aliases
alias g='git'
@yakup
yakup / untrack_git_files.md
Created May 29, 2019 09:03
How to untrack files in git
@yakup
yakup / introrx.md
Created December 16, 2019 11:14 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
@yakup
yakup / System Design.md
Created December 6, 2020 15:25 — forked from vasanthk/System Design.md
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@yakup
yakup / DatabaseCleanup.java
Created August 2, 2021 08:26 — forked from JorgenRingen/DatabaseCleanup.java
Clean up database when using @SpringBootTest and initiating transactions from the test. Test and server runs in different threads.
package no.vegvesen.kjoretoy.registrering.register.web;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.persistence.Table;
import java.util.List;
import java.util.stream.Collectors;
import org.springframework.beans.factory.InitializingBean;
package com.baeldung.restassured.authentication;
import static io.restassured.RestAssured.get;
import static io.restassured.RestAssured.given;
import static org.hamcrest.Matchers.hasKey;
import org.junit.jupiter.api.Test;
import org.springframework.http.HttpStatus;
/**