Skip to content

Instantly share code, notes, and snippets.

View SafeerH's full-sized avatar

Safeer Hussain SafeerH

View GitHub Profile
@SafeerH
SafeerH / XmlHelper.cs
Created November 26, 2014 06:21
C# ToXml and FromXml
public static class FormattingExtensions
{
public static string ToXml(this object o)
{
XmlSerializer serializer = new XmlSerializer(o.GetType());
using (StringWriter writer = new StringWriter())
{
serializer.Serialize(writer, o);
return writer.ToString();
}

Libraries

  • jQuery - The de-facto library for the modern age. It makes things like HTML document traversal and manipulation, event handling, animation, and Ajax much simpler with an easy-to-use API that works across a multitude of browsers.
  • Backbone - Backbone.js gives structure to web applications by providing models with key-value binding and custom events, collections with a rich API of enumerable functions, views with declarative event handling, and connects it all to your existing API over a RESTful JSON interface.
  • AngularJS - Conventions based MVC framework for HTML5 apps.
  • Underscore - Underscore is a utility-belt library for JavaScript that provides a lot of the functional programming support that you would expect in Prototype.js (or Ruby), but without extending any of the built-in JavaScript objects.
  • lawnchair - Key/value store adapter for indexdb, localStorage

Libraries

  • 960 Grid System - An effort to streamline web development workflow by providing commonly used dimensions, based on a width of 960 pixels. There are two variants: 12 and 16 columns, which can be used separately or in tandem.
  • Compass - Open source CSS Authoring Framework.
  • Bootstrap - Sleek, intuitive, and powerful mobile first front-end framework for faster and easier web development.
  • Font Awesome - The iconic font designed for Bootstrap.
  • Zurb Foundation - Framework for writing responsive web sites.
  • SASS - CSS extension language which allows variables, mixins and rules nesting.
  • Skeleton - Boilerplate for responsive, mobile-friendly development.

Guides

@SafeerH
SafeerH / DelayedTrigger.cs
Last active August 29, 2015 14:07
Delayed Trigger (trigger event after 1 second)
public partial class Form1 : Form
{
private DateTime _lastScrollEvent = new DateTime(0);
private async void DetectShapeAsync()
{
labelUTVal.Text = (trackBarUniquenessThreshold.Value / 100d).ToString();
labelHTVal.Text = trackBarHessianThresh.Value.ToString();
_lastScrollEvent = DateTime.Now;
@SafeerH
SafeerH / css-scroll-shadow.css
Last active August 29, 2015 14:05
Show the top and bottom inset-shadows to a scrollable div
.scrollbox {
overflow: auto;
width: 200px;
max-height: 200px;
margin: 50px auto;
background:
/* Shadow covers */
linear-gradient(white 30%, rgba(255,255,255,0)),
linear-gradient(rgba(255,255,255,0), white 70%) 0 100%,
@SafeerH
SafeerH / js-smooth-scroll.js
Last active August 29, 2015 14:05
Smooth scroll to an element with jQuery
/// Usage: (HTML)
///
/// <a data-smooth-scroll href="#section1">Section 1</a>
///
/// <div id="section1">This is section 1</div>
$(document).ready(function() {
$('a[href^="#"][data-smooth-scroll]').on('click', function(event) {