Skip to content

Instantly share code, notes, and snippets.

View keremgocen's full-sized avatar

kerem keremgocen

View GitHub Profile
#### Touchpad clickfinger
disable middle click area and use 3 fingers instead
> sudo pacman -S xf86-input-libinput
> sudo nano /usr/share/X11/xorg.conf.d/40-libinput.conf
`Option "Tapping" "on"`: tapping a.k.a. tap-to-click
`Option "ClickMethod" "clickfinger"`: trackpad no longer has middle and right button areas and instead two-finger click is a context click and three-finger click is a middle click, see the docs.
`Option "NaturalScrolling" "true"`: natural (reverse) scrolling
`Option "TappingButtonMap" "lrm"`: set 1/2/3-finger taps to left/right/middle
@keremgocen
keremgocen / flatten array
Last active January 17, 2019 00:42
flattens an array by converting it to a string and stripping out brackets
// strip out all square brackets then join by `,` into an array
const flatten = arr => {
const newArr = arr.replace(/[[\]]/g, '')
return newArr.split(',').map(Number)
}
function demo() {
const inputArr = [
[1, 2, [3]], 4
]
@keremgocen
keremgocen / -README.md
Created July 11, 2018 16:04 — forked from jirutka/-README.md
How to use terminal on Windows and don’t go crazy…

How to use terminal on Windows without going crazy…

Windows is really horrible system for developers and especially for devops. It doesn’t even have a usable terminal and shell, so working with command line is really pain in the ass. If you really don’t want to switch to any usable system (OS X, Linux, BSD…), then this guide should help you to setup somewhat reasonable environment – usable terminal, proper shell, ssh client, git and Sublime Text as a default editor for shell.

Install stuff

  1. Download and install Git for Windows* with:
    • [✘] Use Git from the Windows Command Prompt
  • [✘] Checkout as-is, commit Unix-style line endings
@keremgocen
keremgocen / how-to-copy-aws-rds-to-local.md
Created November 21, 2017 23:53 — forked from syafiqfaiz/how-to-copy-aws-rds-to-local.md
How to copy production database on AWS RDS(postgresql) to local development database.
  1. Change your database RDS instance security group to allow your machine to access it.
    • Add your ip to the security group to acces the instance via Postgres.
  2. Make a copy of the database using pg_dump
    • $ pg_dump -h <public dns> -U <my username> -f <name of dump file .sql> <name of my database>
    • you will be asked for postgressql password.
    • a dump file(.sql) will be created
  3. Restore that dump file to your local database.
    • but you might need to drop the database and create it first
    • $ psql -U <postgresql username> -d <database name> -f <dump file that you want to restore>
  • the database is restored
@keremgocen
keremgocen / cloudSettings
Created June 1, 2017 22:28
Visual Studio Code Settings Sync Gist
{"lastUpload":"2017-06-01T22:28:54.336Z","extensionVersion":"v2.8.1"}
@keremgocen
keremgocen / GIF-Screencast-OSX.md
Created June 23, 2016 08:18 — forked from dergachev/GIF-Screencast-OSX.md
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

import os
def print_directory_contents(sPath, level):
"""
This function takes the name of a directory
and prints out the paths files within that
directory as well as any files contained in
contained directories.
"""
level += 1
@keremgocen
keremgocen / blesh_android_manifest.xml
Last active August 29, 2015 14:12
Blesh SDK Android manifest definitions
<!-- BLE is not supported for devices running on OS lower than Android 4.3.
It is perfectly ok to use a lower minimum or higher target version if your application supports a broader range.
Although Blesh service will not operate on those lower versions. It will not throw an exception, it will not start and it will just stay down.
This should not affect the rest of your application. -->
<uses-sdk
android:minSdkVersion="18"
android:targetSdkVersion="19" />
<!-- Blesh SDK required permissions -->