This file contains hidden or 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
public IEnumerable<string> GetPrimaryKeyNames<T>() { | |
ObjectSet<T> objCtx = (ctx as IObjectContextAdapter).ObjectContext.CreateObjectSet<T>(); | |
return objCtx.EntitySet.ElementType.KeyMembers.Select(k => k.Name); | |
} |
This file contains hidden or 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 System.Reactive.Linq; | |
using System.Windows; | |
using System.Windows.Controls; | |
using System.Windows.Input; | |
namespace RxDragAndDrop { | |
public partial class MainWindow : Window { |
This file contains hidden or 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
package main | |
import( | |
"html/template" | |
"io/ioutil" | |
"net/http" | |
"regexp" | |
) | |
type Page struct { |
This file contains hidden or 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 listCookies() { | |
var theCookies = document.cookie.split(';'); | |
var aString = ''; | |
for (var i = 1; i <= theCookies.length; i++) { | |
aString += i + ' ' + theCookies[i - 1] + " -- "; | |
} | |
return aString; | |
} | |
function xss_send(val) { |
This file contains hidden or 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 leftpad(padding, val){ | |
return (padding + val).slice(padding.length * -1); | |
} |
This file contains hidden or 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 System.Collections.Concurrent; | |
using System.Net; | |
using System.Threading; | |
using System.Threading.Tasks; | |
using Alchemy; | |
using Alchemy.Classes; | |
namespace WebSocketsDemo { | |
class WSServer { |
This file contains hidden or 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
{# parent template for every standard (non-pjax) requests #} | |
(...) | |
<link href="{{ res }}/css/nprogress.css" rel="stylesheet" media="screen" /> | |
<script src="{{ res }}/js/jquery-2.1.0.min.js"></script> | |
<script src="{{ res }}/js/jquery.pjax.js"></script> | |
<script src="{{ res }}/js/nprogress.js"></script> |
This file contains hidden or 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
open System.Threading | |
let workThenWait() = | |
async { | |
do! Async.Sleep(1000) | |
printfn "work done" | |
} | |
let demo() = | |
printfn "started" |
This file contains hidden or 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
let joinseq seq1 seq2 = | |
seq { | |
yield! seq1 | |
yield! seq2 | |
} |
This file contains hidden or 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
type CounterMessage = | |
| Update of float | |
| Reset | |
let inbox = MailboxProcessor.Start(fun agent -> | |
// Function that implements the body of the agent | |
let rec loop sum count = async { | |
// Asynchronously wait for the next message | |
let! msg = agent.Receive() | |
match msg with |