This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def get_logger(): | |
""" | |
Returns a logger object that can directly be used. | |
It is a single function singleton, | |
it returns the same object each time it is called. | |
Do not forget to change: | |
logger_name = "defaultlogger" | |
logger_file_path = "log1.log" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace SomeNamespace | |
{ | |
using System; | |
class CustomException : Exception | |
{ | |
public CustomException() | |
: base() { } | |
public CustomException(string message) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
public class Program | |
{ | |
public static void Main() | |
{ | |
// simple string interpolation | |
string someString = @" | |
Do you have a {0} {1} ? | |
"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
public class Program | |
{ | |
public static void Main() | |
{ | |
List<string> listed = new List<string>() {"1", "2", "3", "4"}; | |
Console.WriteLine(">" + string.Join("-", listed)); | |
// >1-2-3-4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
""" | |
TODO:doc here | |
""" | |
def main(): | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
python -m SimpleHTTPServer 8090 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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"/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# DOSBox is a great emulator to run old DOS games | |
# and applications. | |
# This configuration has been tested on Ubuntu 11.04 with DOSBox 0.74 | |
# but# it should work on other distros too. | |
# This code snippet runs on a fresh install of DOSBox | |
# since it appends lines to DOSBox configuration file. | |