This file contains hidden or 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
| #!/bin/sh | |
| SHORTCUT="[Desktop Entry] | |
| Name=Sublime Text 3 | |
| Comment=Edit text files | |
| Exec=/usr/local/sublime-text-3/sublime_text | |
| Icon=/usr/local/sublime-text-3/Icon/128x128/sublime_text.png | |
| Terminal=false | |
| Type=Application | |
| Encoding=UTF-8 | |
| Categories=Utility;TextEditor;" |
This file contains hidden or 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 Nancy; | |
| namespace SillyWebsite | |
| { | |
| public class SillyModule : NancyModule | |
| { | |
| public SillyModule() : base("/{chicken}/with/cheese") | |
| { | |
| Get["/"] = _ => | |
| { |
This file contains hidden or 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
| // Docs URL: http://datatables.net/reference/event/processing | |
| // This is your DataTable in the DOM. | |
| $('#example') | |
| // Listen for the processing event. | |
| .on('processing.dt', function(e, settings, processing) { | |
| // The processing variable is a boolean. | |
| if (processing) | |
| showCustomProcessingEffects(); | |
| else |
This file contains hidden or 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 static ExpandoObject ToExpando(this object obj) | |
| { | |
| IDictionary<string, object> expando = new ExpandoObject(); | |
| foreach (var info in obj.GetType().GetProperties()) | |
| expando.Add(new KeyValuePair<string, object>(info.Name, info.GetValue(obj))); | |
| return (ExpandoObject)expando; | |
| } |
This file contains hidden or 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
| require 'rubygems' | |
| require 'nokogiri' | |
| require 'open-uri' | |
| urls = ['First', 'Second', 'Third', 'Fourth', 'Fifth', 'Sixth', 'Seventh', 'Eighth'] | |
| .map {|ordinal| "http://www.bigiqkids.com/SpellingVocabulary/Lessons/wordlistSpelling#{ordinal}Grade.shtml"} | |
| 8.times do |number| | |
| page = Nokogiri::HTML(open(urls[number])) |
This file contains hidden or 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 (var ctx = new CloudPanelContext(@"Database=[Name your DB];Server=.\SQLSERVER;Integrated Security=true")) | |
| { | |
| // Do stuff with data... | |
| ctx.SaveChanges(); | |
| } |
This file contains hidden or 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.Linq; | |
| using System.Text.RegularExpressions; | |
| using System.Collections.Generic; | |
| using System.Globalization; | |
| namespace MyNamespace | |
| { | |
| public class HumanStringWithNumbersComparer : StringComparer | |
| { |
This file contains hidden or 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 static Func<A, R> Memoize<A, R>(this Func<A, R> f) | |
| { | |
| var cache = new System.Collections.Concurrent.ConcurrentDictionary<A, R>(); | |
| return a => cache.GetOrAdd(a, f); | |
| } |
This file contains hidden or 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/python3 | |
| # -*- coding: utf-8 -*- | |
| import string | |
| from fileinput import input | |
| from os.path import dirname, basename, isdir, isfile, join, splitext | |
| from shutil import copy2 | |
| def copyProject(project, destinationDir = ""): | |
| projectDir = dirname(project) |
This file contains hidden or 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 AdmitOne.Domain.Entities; | |
| using System.Data.Entity; | |
| using System.Data.Entity.Infrastructure; | |
| using System.Data.Entity.ModelConfiguration.Conventions; | |
| namespace AdmitOne.Persistence.Ticketing | |
| { | |
| public class TicketingSession : Session | |
| { | |
| public TicketingSession() : base(new TicketingContext()) { } |