Skip to content

Instantly share code, notes, and snippets.

@anaisbetts
anaisbetts / request-rx.js
Created February 18, 2015 06:36
Rx'ification of request
'use 6to5';
const rx = require('rx');
const request = require('request');
let wrapMethodInRx = (method) => {
return function(...args) {
return rx.Observable.create((subj) => {
// Push the callback as the last parameter
args.push((err, resp, body) => {
@isGabe
isGabe / index.html
Created May 22, 2013 17:31
HTML/CSS/JS: Mobile Menu Toggle with CSS Transitions & JS Fallback #snippet
<a id="mobile-menu-toggle" href="#">Menu</a>
<nav id="main-nav" class="closed">
<ul>
<li><a href="#">One</a></li>
<li><a href="#">Two</a></li>
<li><a href="#">Three</a></li>
<li><a href="#">Four</a></li>
<li><a href="#">Five</a></li>
</ul>
@cureos
cureos / MvxCloseableWpfViewPresenter.cs
Last active December 20, 2015 01:59
WPF specific view presenter class supporting closing an MVVMCross based application
public class MvxCloseableWpfViewPresenter : MvxWpfViewPresenter
{
#region FIELDS
private readonly Window _window;
#endregion
#region CONSTRUCTORS
@anaisbetts
anaisbetts / GravatarLoader.cs
Created August 14, 2013 16:20
Gravatar loading and caching using Akavache and Splat
using System;
using Akavache;
using Splat;
using System.Security.Cryptography;
using System.Text;
using System.Globalization;
using ReactiveUI;
using System.Reactive.Linq;
using System.Reactive.Threading.Tasks;
@herskinduk
herskinduk / ArticleViewRendering.cshtml
Last active April 29, 2016 08:34
Sitecore MVC inside-out layout
@using Sitecore.Mvc.Presentation
@using Sitecore.Mvc
@model RenderingModel
@{
Layout = null;
Sitecore.Context.Items["twitter:title"] = Model.Item["title"]
Sitecore.Context.Items["twitter:description"] = Model.Item["description"]
}
<h1>@Html.Sitecore().Field("title")</h1>
@Html.Sitecore().Field("text")
@skayred
skayred / asp-net-webapi.cs
Created October 17, 2012 07:56
Nancy and ASP.NET Web API comparison
namespace aspapi.Controllers
{
public class TaskApiController : ApiController
{
private readonly ITaskRepository taskRepository;
public TaskApiController()
{
taskRepository = new TaskRepository();
}
@yocontra
yocontra / LazyLoad.js
Created December 2, 2014 01:23
lazy loading react components, useful for video/audio/etc
var React = require('react');
var events = require('add-event-listener');
var isVisible = require('../isVisible');
var LazyLoad = React.createClass({
displayName: 'LazyLoad',
propTypes: {
distance: React.PropTypes.number,
component: React.PropTypes.node.isRequired,
children: React.PropTypes.node.isRequired
@zippy1981
zippy1981 / .gitignore
Created October 9, 2011 13:28
Powershell Scripts to load evetlogs into mongodb and then query them
*~
@kamsar
kamsar / Install Solr.ps1
Last active February 26, 2019 14:30
Sitecore Solr Cannon
# This script will set up (and install if needed) Apache Solr for a Sitecore instance.
# This does NOT configure Sitecore to use Solr,
# just the Solr server and cores for Sitecore to connect to once it is set up to use Solr.
# So, what does it do?
#
# * Installs SOLR, if needed, from the Bitnami SOLR stack: https://bitnami.com/stack/solr/installer
# * Creates a SOLR config set for the cores to share (shared schema)
# * Creates SOLR cores for all Sitecore indexes, including secondary cores to support online reindexing (Switch on Rebuild)
@sanderhahn
sanderhahn / gulpfile.js
Last active September 11, 2019 14:45
Minify and templateCache your Angular Templates using Gulp
var gulp = require('gulp');
var uglify = require('gulp-uglify');
var concat = require('gulp-concat');
var templates = require('gulp-angular-templatecache');
var minifyHTML = require('gulp-minify-html');
// Minify and templateCache your Angular Templates
// Add a 'templates' module dependency to your app:
// var app = angular.module('appname', [ ... , 'templates']);