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.Generic; | |
| using System.Linq; | |
| using System.Linq.Expressions; | |
| using System.Reflection; | |
| namespace ConsoleApplication3 | |
| { | |
| public class Program | |
| { |
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
| foreach (string prop in props) | |
| { | |
| if (prop == "Count") | |
| { | |
| var countMethod = (typeof(Enumerable)).GetMethods().First(m => m.Name == "Count").MakeGenericMethod(type); | |
| expr = Expression.Call(countMethod, expr); | |
| break; | |
| } | |
| PropertyInfo pi = type.GetProperty(prop); |
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 interface IRepository | |
| { | |
| IQueryable<T> Query<T>() where T : class; | |
| T Add<T>(T entity) where T : class; | |
| T Update<T>(T entity) where T : class; | |
| void Delete<T>(T entity) where T : class; | |
| } | |
| public class Repository : IRepository | |
| { |
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
| <div> | |
| </div> | |
| <script> | |
| var o = { | |
| test1 : 50, | |
| test2 : 'Test', | |
| test3: { | |
| test4: 'test1', | |
| test5: [1,2,3] |
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
| var util = require('util'); | |
| var logentries = require('node-logentries'); | |
| var log = logentries.logger({ | |
| token:'11111111-2222-3333-4444-555555555555' | |
| }); | |
| var d = require('domain').create(); | |
| d.on('error', function(err){ | |
| try { |
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
| ini_set('display_errors',1); | |
| ini_set('display_startup_errors',1); | |
| error_reporting(-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
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="utf-8"> | |
| <meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1"> | |
| <title>Bootstrap 101 Template</title> | |
| <!-- Bootstrap --> | |
| <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css"> |
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
| class AsynctestController < ApplicationController | |
| require "em-synchrony/em-http" | |
| def test | |
| EventMachine.synchrony do | |
| http = EventMachine::HttpRequest.new("https://www.google.co.uk/").get | |
| render :json => {result: http.response} |
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
| $('#table').dataTable({ | |
| ajax: '/things', | |
| columns:[ | |
| {data: 'col1', visible: false }, | |
| {data: 'col2', title:'col2', dataSort:'0'} | |
| ] | |
| }); |
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
| while true; do curl -w %{http_code}:%{time_total} http://www.google.com/ -o /dev/null -s; printf "\n"; sleep 0.5; done |
OlderNewer