Skip to content

Instantly share code, notes, and snippets.

View ismaelhamed's full-sized avatar
🚀
lezduit

Ismael Hamed ismaelhamed

🚀
lezduit
  • Spain
  • 00:53 (UTC +02:00)
View GitHub Profile
@ismaelhamed
ismaelhamed / UnixDateTimeConverter.cs
Last active January 2, 2016 12:48
*NIX Epoch integer converter for DateTime
using System;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
public class UnixDateTimeConverter : DateTimeConverterBase
{
/// <summary>
/// Reads the JSON representation of the object.
/// </summary>
/// <param name="reader">The <see cref="JsonReader"/> to read from.</param>
@ismaelhamed
ismaelhamed / NameValueCollectionExtensions.cs
Last active December 25, 2015 02:49
Some extension methods for the object NameValueCollection
namespace System.Collections.Specialized
{
using System.Collections.Generic;
using System.Linq;
using System.Net;
public static class NameValueCollectionExtensions
{
public static IDictionary<string, string> ToDictionary(this NameValueCollection source)
{
@ismaelhamed
ismaelhamed / NameValueCollection.cs
Last active March 27, 2018 11:34
Represents a collection of associated String keys and String values that can be accessed either with the key or with the index. Portable version.
namespace System.Collections.Specialized
{
using System.Collections.Generic;
using System.Linq;
/// <summary>
/// Represents a collection of associated String keys and String values that can be accessed either with the key
/// or with the index.
/// </summary>
public class NameValueCollection : IEnumerable<KeyValuePair<string, string>>

NPM Cheat Sheet

(Full description and list of commands at - https://npmjs.org/doc/index.html)

##List of less common (however useful) NPM commands

######Install a package and also update package.json with the installed version and package name.

@ismaelhamed
ismaelhamed / IEnumerableExtensions
Created May 17, 2013 14:18
Collection of extensions methods for IEnumerable
public static class IEnumerableExtensions
{
/// <summary>
/// Batches up an enumerable and yields you a sequence of arrays.
/// </summary>
public static IEnumerable<T[]> Batch<T>(this IEnumerable<T> sequence, int batchSize)
{
var batch = new List<T>(batchSize);
foreach (var item in sequence)
using Telerik.Windows.Controls;
namespace System.Windows.Interactivity
{
public class PullToRefreshBehavior : Behavior<RadDataBoundListBox>
{
/// <summary>
/// Gets or sets a value indicating whether the RefreshLabel in the PullToRefreshLoading indicator should be updated.
/// </summary>
public bool UpdateRefreshLabel { get; set; }
var mongoose = require('mongoose');
mongoose.connect('localhost', 'testing_multiTenant');
/**
* User schema.
*/
var UserSchema = new mongoose.Schema({
name: String
, prefix: { type: String, required: true }