Skip to content

Instantly share code, notes, and snippets.

View dbtek's full-sized avatar
⌨️
crafting...

Ismail Demirbilek dbtek

⌨️
crafting...
  • Istanbul
View GitHub Profile
@dbtek
dbtek / router.tsx
Created September 14, 2024 18:33
Dead simple router for React
import React, { createContext, useEffect, useState } from 'react';
// See https://create-react-app.dev/docs/using-the-public-folder/
const PUBLIC_URL = '';
/**
* Router usage:
* <Router>
* <Route path="/" component={HomePage} />
* <Route path="/about" component={AboutPage} />
@dbtek
dbtek / .eslintrc.js
Created November 25, 2021 11:08
React Typescript Eslint & Prettier
module.exports = {
ignorePatterns: ['.eslintrc.js'],
env: {
browser: true,
es2021: true,
},
extends: [
'eslint:recommended',
'plugin:react/recommended',
'plugin:react-hooks/recommended',
@dbtek
dbtek / howto.md
Last active October 14, 2021 11:32
VSCode Eslint Fix on Save

Add following to settings.json:

{
    "editor.codeActionsOnSave": {
        "source.fixAll.eslint": true
    }
}
@dbtek
dbtek / uppy.js
Created November 2, 2020 16:16
Uppy dashboard with custom form (w/ select) auto edit mode
const uppy = new Uppy.Core({
meta: {
foo: 'bar'
}
})
.use(Uppy.Dashboard, {
target: '#dashboard',
replaceTargetContent: true,
inline: true,
metaFields: [{
// ==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 October 15, 2018 20:40
CircleCI - Hangouts Chat Notifications
version: 2
jobs:
deploy:
docker:
# little bit tuned node image with git & curl
- image: ifenerji/node-alpine-git:latest
working_directory: ~/repo
steps:
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 09:03
Formatted relative time
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
}
@dbtek
dbtek / cloudSettings
Last active March 11, 2020 09:39
Visual Studio Code Settings Sync Gist
{"lastUpload":"2020-02-20T20:05:59.567Z","extensionVersion":"v3.4.3"}
@dbtek
dbtek / venv_wrapper
Last active July 31, 2024 08:53
Python 3 venv wrapper. Manages all virtual environments under ~/.venv/ .
# venv_wrapper, manage all virtual environments under ~/.venv/
# Include the following in .bashrc / .bash_profile / .zshrc
# See https://gist.github.com/dbtek/fb2ddccb18f0cf63a654ea2cc94c8f19
#
# Usage:
# $ mkvenv myvirtualenv # creates venv under ~/.venv/
# $ venv myvirtualenv # activates venv
# $ deactivate # deactivates venv
# $ rmvenv myvirtualenv # removes venv
# $ rmvenv env1 env2 # removes multiple venvs