Skip to content

Instantly share code, notes, and snippets.

Avatar
💤
oo

Ismail Demirbilek dbtek

💤
oo
View GitHub Profile
@dbtek
dbtek / .eslintrc.js
Created Nov 25, 2021
React Typescript Eslint & Prettier
View .eslintrc.js
module.exports = {
ignorePatterns: ['.eslintrc.js'],
env: {
browser: true,
es2021: true,
},
extends: [
'eslint:recommended',
'plugin:react/recommended',
'plugin:react-hooks/recommended',
@dbtek
dbtek / venv_wrapper
Last active Nov 11, 2021
Python 3 venv wrapper. Manages all virtual environments under ~/.venv/ .
View venv_wrapper
# include following in .bashrc / .bash_profile / .zshrc
# usage
# $ mkvenv myvirtualenv # creates venv under ~/.venv/
# $ venv myvirtualenv # activates venv
# $ deactivate # deactivates venv
# $ rmvenv myvirtualenv # removes venv
export VENV_HOME="$HOME/.venv"
[[ -d $VENV_HOME ]] || mkdir $VENV_HOME
@dbtek
dbtek / howto.md
Last active Oct 14, 2021
VSCode Eslint Fix on Save
View howto.md

Add following to settings.json:

{
    "editor.codeActionsOnSave": {
        "source.fixAll.eslint": true
    }
}
@dbtek
dbtek / uppy.js
Created Nov 2, 2020
Uppy dashboard with custom form (w/ select) auto edit mode
View uppy.js
const uppy = new Uppy.Core({
meta: {
foo: 'bar'
}
})
.use(Uppy.Dashboard, {
target: '#dashboard',
replaceTargetContent: true,
inline: true,
metaFields: [{
@dbtek
dbtek / cloudSettings
Last active Mar 11, 2020
Visual Studio Code Settings Sync Gist
View cloudSettings
{"lastUpload":"2020-02-20T20:05:59.567Z","extensionVersion":"v3.4.3"}
View google-redirect-bypass.js
// ==UserScript==
// @name Google Redirect Bypass
// @version 0.1
// @description Google redirect bypass script.
// @author Ismail Demirbilek
// @match https://www.google.com/url*
// @grant none
// ==/UserScript==
(function() {
@dbtek
dbtek / config.yml
Last active Oct 15, 2018
CircleCI - Hangouts Chat Notifications
View config.yml
version: 2
jobs:
deploy:
docker:
# little bit tuned node image with git & curl
- image: ifenerji/node-alpine-git:latest
working_directory: ~/repo
steps:
View gapps-config.txt
Include
# Intended to be used with Open Gapps stock package
# Pico+
CalSync # Install Google Calendar Sync (except if Google Calendar is being installed)
DialerFramework # Install Dialer Framework
GoogleTTS # Install Google Text-to-Speech (Micro+ on 5.0-, Pico+ on 6.0+)
PackageInstallerGoogle # Install Google Package Installer
# Nano+
@dbtek
dbtek / getRelativeTime.js
Last active May 25, 2018
Formatted relative time
View getRelativeTime.js
module.exports = (ms) => {
var seconds = ms / 1000
var hours = Math.floor(seconds / 3600)
seconds -= hours * 3600
var minutes = Math.floor(seconds / 60)
seconds -= minutes * 60
return `${('0' + hours).slice(-2)}:${('0' + minutes).slice(-2)}:${('0' + seconds).slice(-2)}` // 00:13:09
}