Skip to content

Instantly share code, notes, and snippets.

View halit's full-sized avatar

Halit Alptekin halit

View GitHub Profile
@halit
halit / test.py
Created December 4, 2012 20:16
Swap value test
def test1(a,b):
a^=b
b^=a
a^=b
return a,b
def test2(a,b):
temp=a
a=b
b=temp
return a,b
++ dirname powerline.sh
+ export TMUX_POWERLINE_DIR_HOME=.
+ TMUX_POWERLINE_DIR_HOME=.
+ source ./config/helpers.sh
+ source ./config/paths.sh
++ export TMUX_POWERLINE_DIR_LIB=./lib
++ TMUX_POWERLINE_DIR_LIB=./lib
++ export TMUX_POWERLINE_DIR_SEGMENTS=./segments
++ TMUX_POWERLINE_DIR_SEGMENTS=./segments
++ export TMUX_POWERLINE_DIR_TEMPORARY=/tmp/tmux-powerline_halit
# Default configuration file for tmux-powerline.
# Modeline {
# vi: foldmarker={,} foldmethod=marker foldlevel=0 tabstop=4 filetype=sh
# }
# General {
# Show which segment fails and its exit code.
export TMUX_POWERLINE_DEBUG_MODE_ENABLED="false"
# Use patched font symbols.
export TMUX_POWERLINE_PATCHED_FONT_IN_USE="true"
@halit
halit / cat.c
Last active December 16, 2015 15:49
My cat program
/*
* =====================================================================================
*
* Filename: cat.c
*
* Description: My cat program
*
* Version: 1.0
* Created: 25-04-2013 13:58:45
* Compiler: gcc
@halit
halit / tfc.c
Created April 25, 2013 12:43
Two file comparer
/*
* =====================================================================================
*
* Filename: tfc.c
*
* Description: Two File Comparer
*
* Version: 1.0
* Created: 25-04-2013 15:00:15
* Compiler: gcc
@halit
halit / cat2.c
Created April 25, 2013 14:20
My cat program with low level
/*
* =====================================================================================
*
* Filename: cat2.c
*
* Description: My cat program with low level
*
* Version: 1.0
* Created: 25-04-2013 17:01:46
* Compiler: gcc
@halit
halit / db.c
Created April 25, 2013 15:35
Simple database
#include <stdio.h>
#include <assert.h>
#include <stdlib.h>
#include <errno.h>
#include <string.h>
#define MAX_DATA 512
#define MAX_ROWS 100
struct Address {
@halit
halit / helloworld.hl
Created May 4, 2013 22:31
First hello world my funny programming language hl!
("h", 1);
(---)(+++++++)()(+++)(-------------------------------------------------------------------------------)(+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++)(--------)(+++)(------)(--------)(-------------------------------------------------------------------);
@halit
halit / bitget.c
Last active December 17, 2015 05:19
getting bit value function inspired by duff's device
#define bitGet(v, n) ((v >> n) & 1)
int bitGet(int v, int n){
switch(n - 1){
case 7: v >>= 1;
case 6: v >>= 1;
case 5: v >>= 1;
case 4: v >>= 1;
case 3: v >>= 1;
case 2: v >>= 1;
# Thanking everyone who wished me on my birthday
import requests
import json
# Aman's post time
AFTER = 1353233754