This file contains 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>tableToExcel Demo</title> | |
<script src="tableToExcel.js"></script> | |
</head> | |
<body> | |
<h1>tableToExcel Demo</h1> | |
<p>Exporting the W3C Example Table</p> |
This file contains 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
@Html.Raw(HttpUtility.HtmlDecode(Profiler.RenderIncludes().ToString())) | |
<script src="@Url.Content("~/Scripts/jquery-1.5.1.min.js")" type="text/javascript"></script> |
This file contains 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
var svg = document.querySelector( "svg" ); | |
var svgData = new XMLSerializer().serializeToString( svg ); | |
var canvas = document.createElement( "canvas" ); | |
var ctx = canvas.getContext( "2d" ); | |
var img = document.createElement( "img" ); | |
img.setAttribute( "src", "data:image/svg+xml;base64," + btoa( svgData ) ); | |
img.onload = function() { |
This file contains 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
factory('sse', ['$rootScope', '$http', function($rootScope, $http) { | |
// https://gist.github.com/migajek | |
var splitOnFirst = function (s, c) { if (!s) return [s]; var pos = s.indexOf(c); return pos >= 0 ? [s.substring(0, pos), s.substring(pos + 1)] : [s]; }; | |
return { | |
start: function(handlers) { | |
var opt = {}; | |
var sse = new EventSource('/event-stream'); | |
sse.addEventListener('message', function(e) { | |
var parts = splitOnFirst(e.data, ' '); | |
var selector = parts[0]; |
This file contains 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 ServiceStack; | |
using System.Runtime.Remoting; | |
using NUnit.Framework; | |
namespace MyApp.Tests | |
{ | |
public class AppHost : AppSelfHostBase | |
{ | |
public AppHost(): base("My ServiceStack Service", typeof(AppHost).Assembly) |
This file contains 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
/** | |
* Changes value to past tense. | |
* Simple filter does not support irregular verbs such as eat-ate, fly-flew, etc. | |
* http://jsfiddle.net/bryan_k/0xczme2r/ | |
* | |
* @param {String} value The value string. | |
*/ | |
Vue.filter('past-tense', function(value) { | |
// Slightly follows http://www.oxforddictionaries.com/us/words/verb-tenses-adding-ed-and-ing | |
var vowels = ['a', 'e', 'i', 'o', 'u']; |
This file contains 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
<# | |
.SYNOPSIS | |
Resize an image | |
.DESCRIPTION | |
Resize an image based on a new given height or width or a single dimension and a maintain ratio flag. | |
The execution of this CmdLet creates a new file named "OriginalName_resized" and maintains the original | |
file extension | |
.PARAMETER Width | |
The new width of the image. Can be given alone with the MaintainRatio flag | |
.PARAMETER Height |
This file contains 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
function Import-Portatour { | |
param ( | |
[parameter(Mandatory=$True,Position=1)] [ValidateScript({ Test-Path -PathType Leaf $_ })] [String] $FilePath, | |
[parameter(Mandatory=$False,Position=2)] [System.URI] $ResultURL | |
) | |
# CONST | |
$CODEPAGE = "iso-8859-1" # alternatives are ASCII, UTF-8 | |
# We have a REST-Endpoint | |
$RESTURL = "https://my.portatour.net/a/api/ImportCustomers/" |
This file contains 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
///<summary> | |
/// ServiceClient Base Extensions | |
/// Author: Riwut Libinuko | |
/// Created Date: 29/12/2015 | |
/// Website : http://blog.libinuko.com | |
/// Copyright(c) 2015 | |
/// Use PostFilesWithRequest<TResponse>(...) , to POST metadata and multiple files attachment in single request | |
///</summary> | |
public static class ServiceClientBaseExtensions | |
{ |
This file contains 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
var groupBy = function(data, key) { // `data` is an array of objects, `key` is the key (or property accessor) to group by | |
// reduce runs this anonymous function on each element of `data` (the `item` parameter, | |
// returning the `storage` parameter at the end | |
return data.reduce(function(storage, item) { | |
// get the first instance of the key by which we're grouping | |
var group = item[key]; | |
// set `storage` for this instance of group to the outer scope (if not empty) or initialize it | |
storage[group] = storage[group] || []; | |
OlderNewer