Skip to content

Instantly share code, notes, and snippets.

View caglartoklu's full-sized avatar

Çağlar Toklu caglartoklu

View GitHub Profile
@caglartoklu
caglartoklu / app.config
Last active December 13, 2015 18:19
Simple app.config usage in C#. #cs #config
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
<appSettings>
<add key="one" value="1"/>
<add key="two" value="2"/>
<add key="three" value="3"/>
<add key="four" value="4"/>
@caglartoklu
caglartoklu / simplehttpserver.sh
Created February 17, 2013 10:54
Simple HTTP Server in Python >= 2.4. #python #http #server
python -m SimpleHTTPServer 8090
@caglartoklu
caglartoklu / .bash_profile
Created February 18, 2013 10:25
.bash_profile configuration for Python 2.6, cx_Oracle 5.1.2, Oracle Client 11.2.0 on RHEL 6.3 #bash #oracle #shell
# save this file as .bash_profile, or merge with the existing one.
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
# Red Hat Enterprise Linux Server release 6.3, x84_64
# Oracle Client 11.2.0 (not Instant Client)
# Python 2.6
@caglartoklu
caglartoklu / datetimestamp.py
Created February 25, 2013 12:56
Returns string representation of datetime objects. #python #datetime
import datetime
def get_datetimestamp(sep_date="", sep_group="_", sep_time="", moment=None):
"""
Returns string representation of datetime objects.
By default, the value will look like "20121212_120102" and it
is safe to use it on file names.
@caglartoklu
caglartoklu / check_on_windows.vim
Created July 14, 2017 06:47
check if on windows on vim #vim
if has("win16") || has("win32") || has("win64")
else
endif
@caglartoklu
caglartoklu / source_file_if_exists.vim
Last active July 14, 2017 06:51
source a file if exists in VimL #vim
try
source $HOME/_vimrc_local
catch /^Vim\%((\a\+)\)\=:E484/
endtry
@caglartoklu
caglartoklu / bin_cleaner.bat
Last active July 2, 2019 06:36
Deletes "bin" and "obj" folders recursively from .NET projects.
REM Introduction to bin_cleaner.bat
REM Deletes "bin" and "obj" folders recursively from .NET projects.
REM This is a simple batch file to DELETE "bin" and "obj" folders
REM for Windows.
REM I use this to really "clean" .NET projects.
REM Usage
REM Copy this to the root of your solution folder.
REM Warning
REM Do not run this in your desktop or documents folder.
REM It will delete all the "bin" and "obj" folders under that folder
@caglartoklu
caglartoklu / pip_upgrade_all.py
Last active July 2, 2019 16:05
upgrade all #python packages using #pip
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Traverses all the Python packages and upgrades them.
"""
from __future__ import print_function
from __future__ import unicode_literals
@caglartoklu
caglartoklu / Vagrantfile
Last active July 12, 2019 14:17
Vagrantfile for development on Ubuntu with vim, Python, Node.js(npm, angular-cli, yarn), Docker
# -*- mode: ruby -*-
# vi: set ft=ruby :
# #############################
# R E A D M E
#
#
# # Requirements
#
@caglartoklu
caglartoklu / install_packages_for_ubuntu_on_windows.sh
Created July 29, 2019 14:20
Install packages for Ubuntu on Windows (Bash on Windows)
# Shell script to prepare an Ubuntu 18.04 LTS for development on Windows 10.
# After downloading the file, uncomment the sections you like.
# Tested with Ubuntu on Windows.
sudo apt update
# __________ utilities
sudo apt install mc p7zip-full p7zip-rar arj
sudo apt install curl tofrodos