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
""" | |
Author : Mridul Ahuja | |
Github : https://github.com/mridah/csv2vcf | |
Description : A small command line tool to convert CSV files to VCard files | |
""" | |
import os | |
import sys | |
import csv |
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
public class SingletonClass implements Serializable { | |
private static volatile SingletonClass sSoleInstance; | |
//private constructor. | |
private SingletonClass(){ | |
//Prevent form the reflection api. | |
if (sSoleInstance != null){ | |
throw new RuntimeException("Use getInstance() method to get the single instance of this class."); |
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 android.annotation.TargetApi; | |
import android.content.Context; | |
import android.content.res.ColorStateList; | |
import android.graphics.Canvas; | |
import android.graphics.Color; | |
import android.graphics.Paint; | |
import android.os.Build; | |
import android.text.Editable; | |
import android.util.AttributeSet; | |
import android.util.TypedValue; |
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
function rfc3339(d) { | |
function pad(n) { | |
return n < 10 ? "0" + n : n; | |
} | |
function timezoneOffset(offset) { | |
var sign; | |
if (offset === 0) { | |
return "Z"; |
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
try: | |
from xml.etree.cElementTree import XML | |
except ImportError: | |
from xml.etree.ElementTree import XML | |
import zipfile | |
""" | |
Module that extract text from MS XML Word document (.docx). | |
(Inspired by python-docx <https://github.com/mikemaccana/python-docx>) |
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
// Module dependencies | |
var express = require('express'), | |
mysql = require('mysql'); | |
// Application initialization | |
var connection = mysql.createConnection({ | |
host : 'localhost', | |
user : 'root', |
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; | |
using System.Text; | |
using System.Windows.Forms; | |
using Microsoft.Win32; | |
namespace RunOnStartup | |
{ | |
/// <summary> | |
/// It attempts to write to HKEY_LOCAL_MACHINE first, which will run on startup on all user accounts. |
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
class PngIconConverter | |
{ | |
/* input image with width = height is suggested to get the best result */ | |
/* png support in icon was introduced in Windows Vista */ | |
public static bool Convert(System.IO.Stream input_stream, System.IO.Stream output_stream, int size, bool keep_aspect_ratio = false) | |
{ | |
System.Drawing.Bitmap input_bit = (System.Drawing.Bitmap)System.Drawing.Bitmap.FromStream(input_stream); | |
if (input_bit != null) | |
{ | |
int width, height; |