Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
BASE_URL=https://waba.360dialog.io
VERSION=v1
MEDIAFILE=/home/ovondra/Pictures/isitokaywithyou.jpg
MEDIARESPONSE=`mktemp`
ls -altr $MEDIAFILE
curl -v -H "D360-API-KEY: $APIKEY" "$BASE_URL/$VERSION/media" --data-binary @$MEDIAFILE -H "Content-Type: image/jpeg" -o $MEDIARESPONSE
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
<html>
<body>
<p>This is a custom pre-chat form hosted on GitHub.</p>
<p><input id="clickMe" type="button" value="Click here, casul"></input></p>
<script type="text/javascript">
document.getElementById('clickMe').addEventListener('click', function() {
window.parent.postMessage({type:"ENQUEUE"},"*");
});
</script>
</body>
public partial class Startup
{
/// <summary>
/// This hax is necessary for signalr2 to work
/// </summary>
private void HackInWebsockets(IAppBuilder app)
{
app.Use((c, n) =>
{
c.Environment.Add("server.Capabilities", new Dictionary<string, object>
@ondravondra
ondravondra / IndexWithId.cs
Created November 12, 2013 14:09
asp.net route for index with integer id parameter
routes.MapRoute(
name: "IndexWithId",
url: "{controller}/{id}",
defaults: new { action = "Index" },
constraints: new RouteValueDictionary { { "id", "[0-9]+" } }
);
[Fault] exception, information=VerifyError: Error #1014: Class mx.controls::ProgressBar could not be found.
at Function/<anonymous>()
at mx.styles::CSSStyleDeclaration/http://www.adobe.com/2006/flex/mx/internal::addDefaultStyleToProtoChain()[E:\dev\4.y\frameworks\projects\framework\src\mx\styles\CSSStyleDeclaration.as:964]
at mx.styles::CSSStyleDeclaration/http://www.adobe.com/2006/flex/mx/internal::addStyleToProtoChain()[E:\dev\4.y\frameworks\projects\framework\src\mx\styles\CSSStyleDeclaration.as:891]
at mx.styles::StyleProtoChain$/initProtoChain()[E:\dev\4.y\frameworks\projects\framework\src\mx\styles\StyleProtoChain.as:250]
at mx.core::UIComponent/http://www.adobe.com/2006/flex/mx/internal::initProtoChain()[E:\dev\4.y\frameworks\projects\framework\src\mx\core\UIComponent.as:10926]
at mx.core::UIComponent/regenerateStyleCache()[E:\dev\4.y\frameworks\projects\framework\src\mx\core\UIComponent.as:10989]
at mx.core::UIComponent/http://www.adobe.com/2006/flex/mx/internal::addingChild()[E:\dev\4.y\frameworks\pr
@ondravondra
ondravondra / EFExtensions.cs
Created November 2, 2012 12:49
C# extension for executing upsert (MERGE SQL command) in EF with MSSQL
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity;
using System.Linq;
using System.Linq.Expressions;
using System.Reflection;
using System.Text;
namespace EFExtensions