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
pulic class Singleton
{
private static readonly object _mutex = new object();
private static Singleton _instance;
private Singleton()
{
}
public static Singleton Instance
@tugberkugurlu
tugberkugurlu / after-project.json
Last active August 29, 2015 14:09
Short Package Names VS. Namespace Like Package Names
"dependencies": {
"kloggy-domain": "",
"kestrel": "1.0.0-*",
"aspnet-diagnostics": "1.0.0-*",
"aspnet-staticfiles": "1.0.0-*",
"aspnet-mvc": "6.0.0-*",
"aspnet-http": "1.0.0-*",
"aspnet-hosting": "1.0.0-*",
"weblistener": "1.0.0-*",
"ms-config": "1.0.0-*",
@tugberkugurlu
tugberkugurlu / build.ps1
Created November 22, 2014 15:52
MSBuild build kicker with MSBuild 14.0
param(
$buildFile = (join-path (Split-Path -parent $MyInvocation.MyCommand.Definition) "build.msbuild"),
$buildParams = "/p:Configuration=Release",
$buildTarget = "/t:Default"
)
& "${env:ProgramFiles(x86)}\MSBuild\14.0\Bin\MSBuild.exe" $buildFile $buildParams $buildTarget /verbosity:diagnostic

Shows the difference between commits on your current branch and the upstream dev branch:

git log --pretty=oneline upstream/dev..
if (oSession.HostnameIs("foobar.qbox.io")) {
oSession.oRequest.headers.Remove("Authorization");
oSession.oRequest["Authorization"] = "Basic BASE64_ENCODED_STRING";
}
@tugberkugurlu
tugberkugurlu / tugberk-git-aliases.sh
Last active August 29, 2015 14:10
Git Aliases widely used by Tugberk Ugurlu (me)
# awesome log: https://gist.github.com/mathiasverraes/4505589
git config --global alias.lg "log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative"
# shows all the new commits in your current branch which are not in dev
# usage: git new
git config --global alias.new 'log --pretty=oneline dev.. --reverse'
# this's the way the log should be.
# Usage: git l origin/dev..
git config --global alias.l 'log --pretty=oneline'
using Nte.Http.Model.RequestCommands;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Web.Http.ModelBinding;
namespace Nte.Http.Infrastructure
{
public class RequestCommandValidator
{
C:\Users\Tugberk>npm install azure -g
azure@0.10.4 C:\Users\Tugberk\AppData\Roaming\npm\node_modules\azure
├── azure-mgmt-subscription@0.9.15
├── azure-gallery@2.0.0-pre.14
├── azure-mgmt-hdinsight@0.9.13
├── node-uuid@1.2.0
├── mime@1.2.11
├── azure-mgmt-storage@0.9.15
├── azure-mgmt-authorization@0.9.0-pre.5
├── azure-mgmt@0.9.15
"dependencies": {
"Microsoft.Composition": "1.0.30" -- Is this nuget dependencies for all frameworks? (yes)
},
"frameworks": {
"dnx451": {
"dependencies": { -- Is this nuget just for dnx451? (yes)
"Blah"
},
"frameworkAssemblies": {
"System.Globalization": "", --This is GAC for dnx451? (yes)
@tugberkugurlu
tugberkugurlu / 1-sense.js
Last active August 29, 2015 14:24
Elasticsearch nested term query, find a matching item inside a nested type collection for a document
PUT users
PUT users/_mapping/group
{
"group" : {
"properties" : {
"users" : {
"type" : "nested",
"properties": {
"id" : {"type": "string", "index": "not_analyzed" },