Skip to content

Instantly share code, notes, and snippets.

Avatar

Barış Güler hwclass

View GitHub Profile
View git branch in terminal
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
export PS1="\u@\h \W\[\033[32m\]\$(parse_git_branch)\[\033[00m\] $ "
View set-redirections-from-spreadsheet.js
const fs = require('fs');
const { exec } = require('child_process');
const readline = require('readline');
const {google} = require('googleapis');
const envs = [
'testing',
'production'
]
View remove_query_string_param.js
const currentUrl = https://blacklane.com/?maintenance_mode=on&foo=baz
function removeQueryString(currentUrl, removeThis) {
const url = new URL(currentUrl);
const query_string = url.search;
const search_params = new URLSearchParams(query_string);
search_params.delete(maintenance_mode);
url.search = search_params.toString();
View nvm.md
curl -L https://raw.githubusercontent.com/creationix/nvm/v0.30.2/install.sh > /tmp/nvm-install.sh && bash /tmp/nvm-install.sh
View rodrigo.js
/* DEBUG=update-city-pages-entries node migration/update-city-pages-entries.ts > out.json 2>&1 */
import * as dotenv from 'dotenv'
const debug = require('debug')('update-city-pages-entries')
const contentful = require('contentful-management')
// const { forcedLocale } = require('../config/export-path-map.js')
// const { benefitsSectionId, contentModels } = require('../config/contenful.js')
// const forcedLocale = 'en-US'
dotenv.config()
View Timestamp.ts
import moment from 'moment'
class Timestamp {
private timestamp: string;
private readonly format = 'YYY-MM-DD HH:mm:ss'
private constructor(timestamp: string) {
this.timestamp = timestamp
}
View OrderId.ts
import uuidv4 from 'uuid/v4';
class OrderId {
private id: string;
private constructor(id: string) {
this.id = id;
}
@hwclass
hwclass / SketchSystems.spec
Created Jul 24, 2018
Sketch for Testing Purposes
View SketchSystems.spec
Sketch for Testing Purposes
First State
go to second step -> Second State
Second State
go to third step -> Third State
Third State
go back to second step -> Second State
go back to first step -> First State
@hwclass
hwclass / b4b-transition.md
Created Jan 2, 2018
Semi-Fragile Transition Period (for Business Client-side Codebase) document
View b4b-transition.md

Blacklane for Business

Semi-Fragile Transition Period (for Business Client-side Codebase)

Update 1: Choosing a client-side framework/library for managing views 👏

Problem:

  • The code is buggy 🐛
  • The code is open for having problems after every release :hurtrealbad:
  • The same codebase occurs side-effects for each functionality as B2C and B4B ♻️
View aggregating.js
[
{ "id": 118748738, "playTime": 12002, "auto": false },
{ "id": 118805291, "playTime": 17307, "auto": false },
{ "id": 118801891, "playTime": 15466, "auto": false },
{ "id": 118793510, "playTime": 5971, "auto": true },
{ "id": 118793313, "playTime": 5865, "auto": false },
{ "id": 118793313, "playTime": 2302, "auto": false },
{ "id": 118793510, "playTime": 6578, "auto": false },
{ "id": 118764182, "playTime": 5726, "auto": false },
{ "id": 118793510, "playTime": 6557, "auto": false },