Skip to content

Instantly share code, notes, and snippets.

View hwclass's full-sized avatar

Barış Güler hwclass

View GitHub Profile
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
}
import uuidv4 from 'uuid/v4';
class OrderId {
private id: string;
private constructor(id: string) {
this.id = id;
}
@hwclass
hwclass / SketchSystems.spec
Created July 24, 2018 17:36
Sketch for Testing Purposes
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 January 2, 2018 12:45
Semi-Fragile Transition Period (for Business Client-side Codebase) document

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 ♻️
@hwclass
hwclass / aggregating.js
Last active December 27, 2017 18:02
SC-1st
[
{ "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 },
Q: How many ways are there to make an AJAX call in Javascipt?
const url = 'http...'
const response = await fetch(url).then(response => response.toJSON())
.then(response => response.data)
Q: How can we write a method like the following:
sum(2)(4)
// returns 6
@hwclass
hwclass / activateCamera.js
Created September 14, 2017 14:30
Activate camera gist
/**
* Retrieves the devices matching the kind property with the inputKind argument
* @param {String} inputKind The type of the input like 'videoinput'
* @param {MediaDeviceInfo} device The device instance
* @return {MediaDeviceInfo} The matching media device
*/
const getDeviceWith = ({ inputKind, device }) => {
return (device.kind === inputKind) && device
}
ssh-keygen -t rsa -b 4096 -C "your_email@example.com"
Enter a file in which to save the key (/Users/you/.ssh/id_rsa): [Press enter]
Enter passphrase (empty for no passphrase): [Type a passphrase]
Enter same passphrase again: [Type passphrase again]
pbcopy < ~/.ssh/id_rsa.pub
Go to the Github profile and update the RSA key there by adding a new name for it
@hwclass
hwclass / gist:c159aef8f03c451b6e4f275274de1ad0
Created July 19, 2017 20:53
AWS-rendered React chocolate chips with Dawson— Part 1: A simple service for serving components
import React from 'react'
export const Header = () => <div>This is header component</div>
* sudo chown -R "$USER":admin /Library/Caches/Homebrew
http://stackoverflow.com/questions/8253362/etc-apt-sources-list-e212-cant-open-file-for-writing
* NerdTREE
https://github.com/vim-scripts/The-NERD-tree
* apt-vim
https://github.com/egalpin/apt-vim#install
* Vim color scheme