Skip to content

Instantly share code, notes, and snippets.

Jess Lilly jesslilly

  • US
Block or report user

Report or block jesslilly

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@jesslilly
jesslilly / SaveAs.cs
Last active Aug 29, 2015
Word SaveAs
View SaveAs.cs
object FileName = tempFilePath;
object FileFormat = msWord.WdSaveFormat.wdFormatFilteredHTML;
object LockComments = false;
object Password = System.Reflection.Missing.Value;
object AddToRecentFiles = false;
object WritePassword = System.Reflection.Missing.Value;
object ReadOnlyRecommended = false;
object EmbedTrueTypeFonts = false;
object SaveNativePictureFormat = System.Reflection.Missing.Value;
object SaveFormsData = false;
@jesslilly
jesslilly / treefun.js
Created Nov 13, 2014
Some fun with trees
View treefun.js
window.addEventListener('load', function(e) {
var trees = new Array(3);
trees[0] = {}; // 0 0
trees[1] = {a : {}}; // 1 1
trees[2] = {a : {}, b: {a : {}, b: {a : {}, b: {}}}}; // 6 3
var nodes = function(tree) {
var count = 0;
var nodes2 = function(tree) {
@jesslilly
jesslilly / CustomJson.cs
Created Jun 25, 2014
JSON to C# POCO converter. I started working on this and then stopped. Saving the code in case I need it later.
View CustomJson.cs
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Threading;
using System.Web.Helpers;
namespace Custom.Utils
{
class CustomJson
{
@jesslilly
jesslilly / FunAPI.cs
Created May 22, 2014
C# Async HttpWebRequest Console POC
View FunAPI.cs
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Text;
using System.Threading.Tasks;
// Assume .NET 4.5
namespace FunAPI
View Microsoft.PowerShell_profile.ps1
#
# vi $profile
# C:\Users\userid\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1
#
new-alias vi "C:\Program Files\Sublime Text 2\sublime_text.exe"
new-alias grep select-string
@jesslilly
jesslilly / date_compare.cs
Created May 19, 2014
Different ways of comparing dates in C#
View date_compare.cs
using System;
using System.Collections.Generic;
using System.Linq;
public class Program
{
public static void Main()
{
DateTime a = DateTime.Now;
DateTime z = DateTime.Parse("2014-06-01 00:00:00");
@jesslilly
jesslilly / expander.js
Created Apr 2, 2014
Expander animates a DIV with javascript. Exercise in less than 1 hour.
View expander.js
var Expander = (function(){
var Expander = function(id) {
this._id = id;
this._elem = elem = document.getElementById(id);
this._step = 0;
this._height = 0;
};
Expander.prototype.expand = function(incr,to) {
var self = this;
var animate = (incr>0 && this._height<to)
@jesslilly
jesslilly / timer.js
Last active Aug 29, 2015
Implement a Timer in javascript. With tests. Took 1 hour to implement from scratch. Could be optimized.
View timer.js
var expect = function(value1) {
return {
toBe: function(value2) {
document.getElementById('test').innerHTML +=
"<pre>"
+ ((JSON.stringify(value1) === JSON.stringify(value2)) ? "Pass " : "Fail ")
+ "(val1: " + JSON.stringify(value1)
+ " val2: " + JSON.stringify(value2)
+ ")</pre><br\>";
}
@jesslilly
jesslilly / wordRepeater.cs
Created Mar 28, 2014
Just a little C# for a sample problem we white board-ed yesterday
View wordRepeater.cs
using System;
public class Program
{
public static void Main()
{
Console.WriteLine(wordRepeater("Hi! ",10));
Console.WriteLine(wordRepeater2("Hello! ",10));
}
public static String wordRepeater(String name, int n) {
@jesslilly
jesslilly / Cake.java
Last active Aug 29, 2015
Jetty, Jersey, Guice, JAXB Sample
View Cake.java
// See http://blog.bdoughan.com/2011/06/using-jaxbs-xmlaccessortype-to.html
@XmlAccessorType(XmlAccessType.PUBLIC_MEMBER)
@XmlRootElement
public class Cake implements PlainTextBean {
private String type;
// The getter is up here since the order of fields affects the order in the
// xml.
public String getType() {
return type;
You can’t perform that action at this time.