Skip to content

Instantly share code, notes, and snippets.

View tugberkugurlu's full-sized avatar
:shipit:
💥 shakalaka

Tugberk Ugurlu tugberkugurlu

:shipit:
💥 shakalaka
View GitHub Profile
import 'loaders.css/loaders.css';
import './index.scss';
import React, { PropTypes } from 'react';
const LoadingIndicator = React.createClass({
propTypes: {
children: PropTypes.array.isRequired,
isLoading: PropTypes.bool.isRequired
},
render: function() {
@tugberkugurlu
tugberkugurlu / .bashrc
Created August 26, 2016 09:35
bash profile on Windows, see http://superuser.com/a/602896
eval `ssh-agent`
ssh-add ~/.ssh/id_rsa
cd /c/dev
@tugberkugurlu
tugberkugurlu / AppBuilderExtensions.cs
Created August 11, 2016 13:41
UseFakeMiddleware and UseCountingMiddleware extensions
namespace Tests
{
using AppFunc = Func<IDictionary<string, object>, Task>;
public static class AppBuilderExtensions
{
/// <summary>
/// Responds with the given status code (<paramref name="statusCode" />) and given response body (<paramref name="responseBody" />) as text/plain content.
/// </summary>
public static IAppBuilder UseFakeMiddleware(this IAppBuilder app, int statusCode, string responseBody)
{
"version": "0.2.0",
"configurations": [
{
"name": "Run Tests",
"type": "node",
"request": "launch",
"program": "${workspaceRoot}/node_modules/mocha/bin/_mocha",
"stopOnEntry": false,
"args": [
@tugberkugurlu
tugberkugurlu / run-tests.ps1
Created August 8, 2016 15:25
Run Mocha PowerShell
$mochaPath = Resolve-Path (Join-Path $PSScriptRoot "..\node_modules\.bin\_mocha.cmd")
$setupPath = Resolve-Path (Join-Path $PSScriptRoot "..\test\setup.js")
$testFiles = Join-Path $PSScriptRoot "..\src\**\*.test.js"
& $mochaPath "$testFiles" --require "$setupPath" --compilers js:babel-register --debug-brk

NEST version: 1.5.0

System.ArgumentException: An item with the same key has already been added.
  at System.ThrowHelper.ThrowArgumentException (ExceptionResource resource) <0x4151e330 + 0x00039> in <filename unknown>:0 
  at System.Collections.Generic.Dictionary`2[TKey,TValue].Insert (System.Collections.Generic.TKey key, System.Collections.Generic.TValue value, Boolean add) <0x41101000 + 0x0019b> in <filename unknown>:0 
  at System.Collections.Generic.Dictionary`2[TKey,TValue].Add (System.Collections.Generic.TKey key, System.Collections.Generic.TValue value) <0x4114c880 + 0x00023> in <filename unknown>:0 
  at System.Collections.ObjectModel.KeyedCollection`2[TKey,TItem].AddKey (System.Collections.ObjectModel.TKey key, System.Collections.ObjectModel.TItem item) <0x414b62f0 + 0x00045> in <filename unknown>:0 
  at System.Collections.ObjectModel.KeyedCollection`2[TKey,TItem].InsertItem (Int32 index, System.Collections.ObjectModel.TItem item) <0x414b6240 + 0x0004b> in <filename unknown>:0 
  at System.Colle
@tugberkugurlu
tugberkugurlu / patch-version.sh
Created July 8, 2016 13:57
Patch project.json version, requires jq to be available on path
#!/bin/bash
for i in "$@"
do
case $i in
-v=*|--version=*)
VERSIONNUMBER="${i#*=}"
shift # past argument=value
;;
*)
@tugberkugurlu
tugberkugurlu / insert.sql
Created June 23, 2016 09:48
T-SQL WHILE Loop and Insert bunch of stuff
USE BritishProverbs
GO
DECLARE @Count AS INT = 100000;
DECLARE @Lorem AS nvarchar(max) = 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.';
WHILE (@Count > 1)
BEGIN
INSERT INTO Proverbs VALUES (1, @Lorem, 1, SYSDATETIMEOFFSET());
SET @Count = (@Count - 1);
{
"Titles" : [
"UID", "PID", "PPID", "C", "STIME", "TTY", "TIME", "CMD"
],
"Processes" : [
[
"root", "13642", "882", "0", "17:03", "pts/0", "00:00:00", "/bin/bash"
]
]
}
{
"authors": ["Sam Saffron", "Marc Gravell", "Nick Craver"],
"owners": ["marc.gravell", "nick.craver"],
"projectUrl": "https://github.com/StackExchange/dapper-dot-net",
"licenseUrl": "http://www.apache.org/licenses/LICENSE-2.0",
"summary": "A high performance Micro-ORM",
"description": "A high performance Micro-ORM supporting SQL Server, MySQL, Sqlite, SqlCE, Firebird etc..",
"version": "1.50-beta9",
"title": "Dapper dot net",
"tags": ["orm", "sql", "micro-orm"],