Skip to content

Instantly share code, notes, and snippets.

@jclement
jclement / gist:2352144
Created April 10, 2012 15:30
Tinkering with Serializers
[DataContract]
public class Contact
{
public Contact()
{
Children = new List<string>();
Other = new Dictionary<string, int>();
}
public Contact(int id, string name, string description)
@jclement
jclement / program.cs
Created July 17, 2012 21:49
Sample API Call
using System;
using System.ServiceModel;
using ConsoleApplication6.TestApi;
namespace ConsoleApplication6
{
class Program
{
static void Main(string[] args)
{
@jclement
jclement / pretty_print_helper.js
Created July 18, 2012 20:08
Javascript function to decorate all pre/code blocks with "prettyPrint" for Google's code highlighting
function styleCode()
{
if (typeof disableStyleCode != "undefined")
{
return;
}
var a = false;
$("pre code").parent().each(function()
@jclement
jclement / robotize.py
Created September 27, 2012 21:48
Robotize Google Contact Photos
#!/usr/bin/env python
# ============================================================
# Configuration file: ~/.gdata
# [gdata]
# user: user@gmail.com
# password: password or per-app password
# ============================================================
import sys
@jclement
jclement / chunkerizer.cs
Last active October 11, 2015 20:28
Code for splitting long messages into chunks giving preference for keeping lines together
using System;
using System.Collections.Generic;
namespace Chunkerizer
{
public delegate string ChunkHeaderGenerator(int chunkIndex);
/// <summary>
///
/// _________________.---.______
@jclement
jclement / _vimrc
Created December 1, 2012 15:22
_vimrc to load additional vimrc / plugins from another folder
let &runtimepath.=',$HOME/My Documents/GitHub/dotfiles/vim/'
source $HOME/My Documents/GitHub/dotfiles/vimrc
@jclement
jclement / gist:4220241
Created December 5, 2012 22:53
Return latest folder in a directory
@echo off
for /f "delims=" %%x in ('dir /od /b \\server\dir\*.*') do set recent=%%x
echo %recent%
@jclement
jclement / vimrc
Created December 6, 2012 17:58
Snippets from vimrc to checkout/diff files with TFS command line client
" Helpers for TFS integration
map <F5> :silent !tf checkout %<CR><CR>
map <C-F5> :silent !tf diff %<CR><CR>
'Outlook VB Macro to move selected mail item(s) to a target folder
Sub MoveToArchive()
On Error Resume Next
Dim ns As Outlook.NameSpace
Dim moveToFolder As Outlook.MAPIFolder
Dim objItem As Object
Set ns = Application.GetNamespace("MAPI")
@jclement
jclement / gist:4479168
Created January 7, 2013 22:34
Helper code to push Crystal Reports folder into Environment to help with periodic startup issues
static void SetCrystalPath()
{
string crpath;
if (Environment.Is64BitProcess)
{
crpath = Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86) + @"\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0\Common\SAP BusinessObjects Enterprise XI 4.0\win64_x64";
}
else
{
crpath = Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles) + @"\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0\Common\SAP BusinessObjects Enterprise XI 4.0\win32_x86";