Skip to content

Instantly share code, notes, and snippets.

Burak Yigit Kaya BYK

Block or report user

Report or block BYK

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 console_reader.py
def read_file_from_console():
while True:
line = raw_input().strip()
if line:
yield line
else:
return
@BYK
BYK / blogger-to-wordpress.py
Last active Aug 21, 2016 — forked from fajran/blogger-to-wordpress.py
A Blogger's backup file to WordPress' WXR converter.Only tested with posts and comments, and NOT with pages. May not be efficient for huge blogs since the script keep all content in the memory during conversion.Released as public domain.
View blogger-to-wordpress.py
# Blogger's backup file to WordPress' WXR converter.
#
# Only tested with posts and comments, and NOT with pages.
# May not be efficient for huge blogs since the script keep
# all content in the memory during conversion.
#
# Released as public domain.
#
# Please note that I converted the labels in Blogspot
# as tags in WordPress. I also hardcoded two categories for the
@BYK
BYK / irccloud-mono.css
Created Jul 25, 2016
IRCCloud Monospace
View irccloud-mono.css
@-moz-document domain("irccloud.com") {
body.font-mono #timeContainer, body.font-mono .buffercontainer, body.font-mono .buffercontainer button.link, body.font-mono .fontChooser__sample, body.font-mono .inputcell textarea, body.font-mono .messageLayout__preview, body.font-mono div.shim {
font-size: 12px;
font-family: monospace;
letter-spacing: 0;
}
}
@BYK
BYK / keybase.md
Created Jun 16, 2016
Verifying myself on Keybase
View keybase.md

Keybase proof

I hereby claim:

  • I am BYK on github.
  • I am byk (https://keybase.io/byk) on keybase.
  • I have a public key whose fingerprint is 70DB C4D9 5802 6B46 032E AB75 A17E E621 C962 DE46

To claim this, I am signing this object:

@BYK
BYK / escape_args.php
Last active Apr 12, 2016
Process call argument escaping on Windows with PHP
View escape_args.php
<?php
/**
* Escapes a single argument to be glued together and passed into
* CreateProcess on Windows through `proc_open`.
*
* Adapted from https://blogs.msdn.microsoft.com/twistylittlepassagesallalike/2011/04/23/everyone-quotes-command-line-arguments-the-wrong-way/
*
* @param string The argument to be escaped
* @result string Escaped argument that can be used in a CreateProcess call
*/
@BYK
BYK / nginx.conf
Created Mar 30, 2016
npm-proxy by Disqus
View nginx.conf
user www-data;
worker_processes 1;
error_log /var/log/nginx/error.log;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
@BYK
BYK / libwindows.py
Last active Mar 11, 2016
sudo for Python 3 on Windows
View libwindows.py
'''
This file is based on the code from https://github.com/JustAMan/pyWinClobber/blob/master/win32elevate.py
Copyright (c) 2013 by JustAMan at GitHub
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
View git.xsh
import itertools
import operator
get_branches = lambda: [branch[1:].strip() for branch in $(git branch --list).split('\n') if branch]
get_remotes = lambda: dict((k, set(v[1] for v in group)) for k, group in itertools.groupby(branch.split('->')[0].split('/') for branch in $(git branch -r).split(), operator.itemgetter(0)) if k)
View sudoku.py
class SudokuSolver(object):
def __init__(self, n=3):
self.n = n
self.size = self.n * self.n
self.matrix = [
[set(range(1, self.size+1)) for i in range(self.size)] for
j in range(self.size)
]
def show(self):
@BYK
BYK / Instructions.md
Last active Aug 29, 2015
KindleIt Manifest for Firefox Share
View Instructions.md
  1. Go to about:config in your Firefox
  2. Right click
  3. New -> String
  4. Name: social.manifest.fivefilters-org
  5. Value: contents of social.manifest.fivefilters-org.raw.json below
  6. Type social.activeProviders in the search box in the config page
  7. Double click on the result
  8. Add ,"http://fivefilters.org":1 right before } in the value
  9. Enter
  10. Restart your Firefox and use the FiveFilters icon showing up when you click on the paper plane share icon
You can’t perform that action at this time.