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
/// <summary> | |
/// Reads database schema from query, generates assembly in the memory, and returns dynamic object | |
/// </summary> | |
public static System.Collections.IEnumerable DynamicSqlQuery(this Database database, string sql, params object[] parameters) | |
{ | |
TypeBuilder builder = DynamicMapper.createTypeBuilder( | |
"MyDynamicAssembly", "MyDynamicModule", "MyDynamicType"); | |
using (System.Data.IDbCommand command = database.Connection.CreateCommand()) | |
{ |
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
private IList<T> ConvertCsvToList<T>(IList<string> csv, string[] header) { | |
var list = new List<T>(); | |
foreach (var row in csv) { | |
var columns = row.Split(','); | |
T obj = (T)Activator.CreateInstance(typeof(T)); | |
for (int i = 0; i < columns.Length; i++) { | |
var h = Regex.Match(header[i].Replace("@", "_"), @"(?<="")(?:\\.|[^""\\])*(?="")").Value; | |
var c = Regex.Match(columns[i], @"(?<="")(?:\\.|[^""\\])*(?="")").Value; | |
var prop = typeof(Em.Schools.Data.Domain.Match).GetProperty(h); |
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
namespace MySweetApp | |
{ | |
using System; | |
using System.Linq.Expressions; | |
using System.Text; | |
using System.Web; | |
using System.Web.Mvc; | |
using System.Web.Mvc.Html; | |
public static class FormHelpers |
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
cinst fiddler4 | |
cinst console-devel | |
cinst sublimetext2 | |
cinst googlechrome | |
cinst windirstat | |
cinst sysinternals | |
cinst 7zip | |
cinst winmerge | |
cinst firefox | |
cinst nodejs |
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
@import "variables.less"; | |
@import "mixins.less"; | |
@import "buttons.less"; | |
@import "modals.less"; | |
#colorbox, #cboxOverlay, #cboxWrapper{position:absolute; top:0; left:0; z-index:10001; overflow:hidden;} | |
#cboxOverlay{position:fixed; width:100%; height:100%;} | |
#cboxMiddleLeft, #cboxBottomLeft{clear:left;} | |
#cboxContent{position:relative;} | |
#cboxLoadedContent{overflow:auto;} |
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 ng-app="app"> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<title>Demo</title> | |
<link href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css" rel="stylesheet"> | |
<style> | |
body { font-family: Calibri } | |
.form-horizontal .checkbox label { |
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 xmlns="http://www.w3.org/1999/xhtml" ng-app="app"> | |
<head> | |
<title>Demo</title> | |
<link href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css" rel="stylesheet"> | |
</head> | |
<body> | |
<div class="container"> | |
<h1>Demo</h1> | |
<div class="row"> |
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
/* Examples: | |
* var test = "test {0} {1}, {2} - {0} {1} {2}".format('a', 'b', 'c'); | |
* var test2 = "the {0} ate the {1}".format("cat", "canary"); | |
*/ | |
String.prototype.format = function () { | |
var self = this; | |
var re = /\{\d+\}/g; | |
var m = self.match(re); | |
var indexes = []; | |
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
/** | |
* Just playing around with Function.prototype.call | |
* jsfiddle: https://jsfiddle.net/jesus_tesh/e7ufpLmz/ | |
**/ | |
console.clear(); | |
console.log("Basic function call"); | |
console.log("===================\n"); |
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 toCamelCase(string) { | |
string = string.toLowerCase().replace(/(?:(^.)|([-_\s]+.))/g, function(match) { | |
return match.charAt(match.length-1).toUpperCase(); | |
}); | |
return string.charAt(0).toLowerCase() + string.substring(1); | |
} |