Skip to content

Instantly share code, notes, and snippets.

@jamiepollock
jamiepollock / DirectiveController.js
Created January 11, 2016 09:16
simpledatepicker - basic angularjs datetime picker for custom Umbraco backoffces. It's a little hacky :/
angular.module("umbraco.directives")
.directive('simpledatepicker', function ($parse, $filter, assetsService) {
return {
restrict: 'E',
scope: {
field: '='
},
controller: function ($scope, $element) {
assetsService.loadCss('/umbraco/lib/datetimepicker/bootstrap-datetimepicker.min.css').then(function () {
var filesToLoad = ["/umbraco/lib/moment/moment-with-locales.js",
@cssquirrel
cssquirrel / FileUploadApiController.cs
Last active January 25, 2019 11:49
Using AngularJS API service and Umbraco API controller to permit users to upload files to the server
// Use whatever namespacing works for your project.
namespace YourSite.Web.Controllers.Api
{
using System.IO;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Threading.Tasks;
using System.Web;
using System.Web.Http;
@abjerner
abjerner / Dashboard.md
Created January 19, 2015 18:40
Adding a dashboard for a custom section

Open /config/Dashboard.config, then add something like:

<section alias="CustomDashboardSection">
  <areas>
    <area>myApp</area>
  </areas>
  <tab caption="Welcome">
    <control addPanel="true" panelCaption="">
/App_Plugins/myApp/dashboard.html
@potch
potch / style.js
Last active August 29, 2015 14:12
2015 JavaScript Style Guide
// Bad
"Your Framework Sucks."
// Bad
"Browserify? Have you heard about WebPack?"
// Bad
"Ember vs Angular: 10 Things You Should Know"
@adactio
adactio / micropub.php
Last active January 20, 2023 16:09
Minimal micropub endpoint.
<?php
# Licensed under a CC0 1.0 Universal (CC0 1.0) Public Domain Dedication
# http://creativecommons.org/publicdomain/zero/1.0/
$mysite = 'https://adactio.com/'; // Change this to your website.
$token_endpoint = 'https://tokens.indieauth.com/token';
$_HEADERS = array();
foreach(getallheaders() as $name => $value) {

“Responsive”:

<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 17.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0)  -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg"
	xmlns:xlink="http://www.w3.org/1999/xlink" 
	x="0px" y="0px"
	viewBox="0 0 21 8" 
	enable-background="new 0 0 21 8"
@CristinaSolana
CristinaSolana / gist:1885435
Created February 22, 2012 14:56
Keeping a fork up to date

1. Clone your fork:

git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream