Skip to content

Instantly share code, notes, and snippets.

@ugursogukpinar
ugursogukpinar / sway-config
Last active March 13, 2024 15:11
wf-recorder for swaywm
set $screenrecorder `bash $HOME/scripts/toggle-screen-recorder.sh`
bindsym --to-code $mod+Shift+R exec $screenrecorder
Verifying my Blockstack ID is secured with the address 16v4EtrSzERFyH6bGFqQLcceCTrioc3HdE https://explorer.blockstack.org/address/16v4EtrSzERFyH6bGFqQLcceCTrioc3HdE
@ugursogukpinar
ugursogukpinar / transaction-durations.sql
Created April 4, 2019 11:32
PostgreSQL get transaction durations
SELECT *, now() - xact_start as duration FROM pg_stat_activity WHERE state IN ('idle in transaction', 'active')
order by now() - xact_start desc
limit 5;
#http://www.akadia.com/services/ssh_test_certificate.html
openssl genrsa -des3 -out server.key 1024
openssl req -new -key server.key -out server.csr
cp server.key server.key.org
openssl rsa -in server.key.org -out server.key
openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt
@ugursogukpinar
ugursogukpinar / keyrepeat.shell
Created January 20, 2016 08:00 — forked from kconragan/keyrepeat.shell
Enable key repeat in Apple Lion for Sublime Text in Vim mode
# Mac OS X Lion introduced a new, iOS-like context menu when you press and hold a key
# that enables you to choose a character from a menu of options. If you are on Lion
# try it by pressing and holding down 'e' in any app that uses the default NSTextField
# for input.
#
# It's a nice feature and continues the blending of Mac OS X and iOS features. However,
# it's a nightmare to deal with in Sublime Text if you're running Vintage (Vim) mode,
# as it means you cannot press and hold h/j/k/l to move through your file. You have
# to repeatedly press the keys to navigate.
@ugursogukpinar
ugursogukpinar / email_server.py
Last active August 29, 2015 14:23
Python development email server
python -m smtpd -n -c DebuggingServer localhost:1025
@ugursogukpinar
ugursogukpinar / http_class.php
Created May 20, 2015 11:37
Php curl HTTP class
class Http {
private $url;
private $postString;
private $httpResponse;
private $ch;
private $headers;
private $errNo;
public function __construct($url , $access_token=null)
{
@ugursogukpinar
ugursogukpinar / check_none.py
Created May 19, 2015 11:43
Best way to check is not None each element of an array in Python
lst = [1,2,3]
if all(v is not None for v in lst):
print "This will print"
lst = [1, None, 3]
if all(v is not None for v in lst):
print "This won't print"