Skip to content

Instantly share code, notes, and snippets.

@halit
halit / run2.py
Created August 24, 2012 09:32
run2.py
from PyQt4 import QtCore
from PyQt4 import QtGui
from PyDuino import Ui_PyDuino
import sys, arduino
class readDigital(QtCore.QThread):
def __init__(self, pin):
QtCore.QThread.__init__(self)
self.pin = pin
@halit
halit / pythonweek.py
Created September 12, 2012 13:47
pythonweek
import re
import urllib
urls = [
"http://eepurl.com/pbre9",
"http://eepurl.com/oZDWD",
"http://eepurl.com/oLWeP"
"http://eepurl.com/ozczX",
"http://eepurl.com/ol9Zf",
"http://eepurl.com/n-ZL5",
@halit
halit / vim.py
Created September 13, 2012 13:25
vim plugin
git submodule add http://github.com/tpope/vim-fugitive.git bundle/fugitive
git submodule add https://github.com/msanders/snipmate.vim.git bundle/snipmate
git submodule add https://github.com/tpope/vim-surround.git bundle/surround
git submodule add https://github.com/tpope/vim-git.git bundle/git
git submodule add https://github.com/ervandew/supertab.git bundle/supertab
git submodule add https://github.com/sontek/minibufexpl.vim.git bundle/minibufexpl
git submodule add https://github.com/wincent/Command-T.git bundle/command-t
git submodule add https://github.com/mitechie/pyflakes-pathogen.git
git submodule add https://github.com/mileszs/ack.vim.git bundle/ack
git submodule add https://github.com/sjl/gundo.vim.git bundle/gundo
@halit
halit / gist:3732133
Created September 16, 2012 11:59
multiro
using System;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
@halit
halit / __init__.py
Created September 18, 2012 21:10 — forked from fatiherikli/__init__.py
decorator examples
def accepts(*accepted_types):
def decorated_function(function):
def inner(*passed_args):
for accepted_type, passed_arg in zip(accepted_types, passed_args):
if not isinstance(passed_arg, accepted_type):
raise TypeError
return function(*passed_args)
return inner
return decorated_function
server {
listen 80;
server_name halitalptekin.com www.halitalptekin.com;
if ($http_host = halitalptekin.com) {
rewrite (.*) http://www.halitalptekin.com$1;
}
@halit
halit / sublime2-python-django.md
Created September 21, 2012 19:42 — forked from vigo/sublime2-python-django.md
Sublime Text 2, Python + Django ve Virtualenv ile otomatik tamamlama + PEP kontrolü

Sublime Text 2, Python + Django ve Virtualenv ile otomatik tamamlama + PEP kontrolü

Gerekenler

  1. [Sublime Text 2][1]
  2. [Sublime Paket Yöneticisi][2]

Kurulum

Zaten python, virtualenv vs gibi şeylerin kurulu olduğunu varsayıyorum.

@halit
halit / mkpdf
Created November 4, 2012 19:24 — forked from ecylmz/mkpdf
#!/bin/bash
# markdown ile yazılan dosyalardan pdf üret.
# Örnek: <betik> ~/examples.md
PATH=/var/lib/gems/1.8/bin:$PATH
[ $# -gt 0 ] || {
echo >&2 "Kullanım: $0 < markdown dosyası>"
echo >&2 "Örnek: $0 ~/examples.md"
@halit
halit / pi.c
Created November 23, 2012 23:55
Pi
/*!
* \file pi.c
* \brief Calculates the nth digit of pi
*/
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
@halit
halit / sparks.py
Created December 2, 2012 00:41 — forked from stefanv/sparks.py
Command line sparks in Python
#!/usr/bin/python
# coding=utf-8
# Python version of Zach Holman's "spark"
# https://github.com/holman/spark
# by Stefan van der Walt <[email protected]>
"""
USAGE: