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
@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" },
@tugberkugurlu
tugberkugurlu / program.cs
Created July 7, 2015 20:17
HttpMessageInvoker sample
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace ConsoleApplication1 {
"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 / program.cs
Last active March 19, 2020 15:32
C# Atomic File Write Sample
using System;
using System.IO;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace AtomicWriteSample
{
class Program
{
C:\Users\Tugberk>npm install azure -g
[email protected] C:\Users\Tugberk\AppData\Roaming\npm\node_modules\azure
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
@tugberkugurlu
tugberkugurlu / Program.cs
Created February 22, 2015 18:39
LogicalSetDataSample sample: CallContext.LogicalSetData and CallContext.LogicalGetData
using System;
using System.Linq;
using System.Runtime.Remoting.Messaging;
using System.Threading;
using System.Threading.Tasks;
namespace LogicalSetDataSample
{
class Program
{
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
{
@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'
if (oSession.HostnameIs("foobar.qbox.io")) {
oSession.oRequest.headers.Remove("Authorization");
oSession.oRequest["Authorization"] = "Basic BASE64_ENCODED_STRING";
}

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

git log --pretty=oneline upstream/dev..