Skip to content

Instantly share code, notes, and snippets.

Barış Güler hwclass

Block or report user

Report or block hwclass

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
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 },
View lima-candidate-notes
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 Sep 14, 2017
Activate camera gist
View activateCamera.js
/**
* 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
}
You can’t perform that action at this time.