Skip to content

Instantly share code, notes, and snippets.

View mesuutt's full-sized avatar

Mesut Taşçı mesuutt

View GitHub Profile
@mesuutt
mesuutt / i3block-take-a-break.sh
Created October 13, 2016 14:56
Break reminder for i3blocks.
#!/bin/bash
#[remind_break]
#command=~/.i3/i3blocks/take-a-break.sh
#interval=10
# Minutes
work_time=20
break_time=5
@mesuutt
mesuutt / System Design.md
Created July 6, 2016 23:08 — forked from vasanthk/System Design.md
System Design Cheatsheet

#System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

##Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@mesuutt
mesuutt / deploy-hugo.sh
Last active January 18, 2019 09:47
bash script for deploying hugo site to github pages.
#!/bin/bash
# bash script for deploying hugo site to github pages.
# I have a two branch develop and master.
# develop branch keeps source files of my blog
# master branch keeps generated website files
# If you have unstaged or not tracked files, script adds these files to stash.
# So you unstash these changes after deploy.
@mesuutt
mesuutt / django-template-filters.py
Last active October 1, 2020 06:39
Useful django template tags and filters
# coding: utf-8
import json
from django import template
from django.utils.dateparse import parse_datetime
from django.utils.html import mark_safe
register = template.Library()
@mesuutt
mesuutt / djang-tables2-base-table.html
Last active August 29, 2015 13:56
Bootstrap style table. Fixed several bugs related pagination and column sorting.
{% spaceless %}
{% load django_tables2 %}
{% load i18n %}
<div class="grid">
<div class="grid-title">
<div class="pull-left">
<div class="icon-title"><i class="icon-eye-open"></i></div>
<span>{{ table.Meta.title }}</span>
<div class="clearfix"></div>
;(function ( $, window, undefined ) {
/*
Handle data layer of the tables.
*/
var CustomDataView = function(options) {
$.extend(this.defaults, options);
}
CustomDataView.prototype = {
data: {}
@mesuutt
mesuutt / middleware.py
Last active January 2, 2016 20:19 — forked from strogonoff/middleware.py
Django middleware for cross-domain XHR. WARNING: Defaults are unsafe here. Make sure to set proper restrictions in production!
from django import http
class XsSharing(object):
"""
This middleware allows cross-domain XHR using the html5 postMessage API.
Access-Control-Allow-Origin: http://foo.example
Access-Control-Allow-Methods: POST, GET, OPTIONS, PUT, DELETE
@mesuutt
mesuutt / aras_kargo_soap.py
Last active February 25, 2016 12:36
ArasKargo Soap API call example with Python suds library.
import logging
from suds.xsd.doctor import ImportDoctor, Import
from suds.client import Client, WebFault
logger = logging.getLogger(__name__)
wsdl_url = 'http://appls-srv.araskargo.com.tr/arascargoservice/arascargoservice.asmx?WSDL'
client = None
@mesuutt
mesuutt / tmux.md
Last active December 30, 2015 03:09

Not: Bu kısayollar benim tmux.conf'umda ayarlanan kısa yollardır. Default bir tmux.conf konfigürasyonunda bu kısayollar farklık gösterebilir.

Kendi .tmux.conf dosyam

CK Kontrol key anlamına gelir.Default'ta Ctrl+b'dir.


Pencere ve Paneler

@mesuutt
mesuutt / Flake8Lint.sublime-settings
Last active December 15, 2015 10:38
Sublime text 2 Settings
{
"pep8_max_line_length": 120,
"ignore": ["E128"]
}