Skip to content

Instantly share code, notes, and snippets.

@bgauduch
bgauduch / multiple-repository-and-identities-git-configuration.md
Last active May 25, 2024 14:24
Git config with multiple identities and multiple repositories

Setup multiple git identities & git user informations

/!\ Be very carrefull in your setup : any misconfiguration make all the git config to fail silently ! Go trought this guide step by step and it should be fine 😉

Setup multiple git ssh identities for git

  • Generate your SSH keys as per your git provider documentation.
  • Add each public SSH keys to your git providers acounts.
  • In your ~/.ssh/config, set each ssh key for each repository as in this exemple:
@ufcpp
ufcpp / Program.cs
Created October 28, 2016 03:33
index付きforeach
// 動作確認用
using System;
using System.Collections;
using System.Collections.Generic;
// ここの using 切り替えで、どの Indexed が呼ばれるかを切り替え
// 手元の環境だと以下の通り(GetTotalMemory の前後差分0が理想)
// A: 0
// B: 237568
// C: 720896
@DanDiplo
DanDiplo / QueryStringHelper.cs
Last active February 7, 2019 16:38
QueryString Helper
// Code examples of using my QueryStringHelper c# class for parsing query string values
// See https://github.com/DanDiplo/QueryString-Helper
QueryStringHelper qs1 = new QueryStringHelper(Request.QueryString); // initialise from Request.QueryString
string query = "?page=5&username=dan&year=2010&enabled=true&email=dan@example.com&option=apple&option=banana&option=melon&date=2015/07/06";
QueryStringHelper qs = new QueryStringHelper(query); // intialise from string
@DanDiplo
DanDiplo / JS-LINQ.js
Last active June 7, 2024 00:50
JavaScript equivalents of some common C# LINQ methods. To help me remember!
// JS array equivalents to C# LINQ methods - by Dan B.
// First: This version using older JavaScript notation for universal browser support (scroll down for ES6 version):
// Here's a simple array of "person" objects
var people = [
{ name: "John", age: 20 },
{ name: "Mary", age: 35 },
{ name: "Arthur", age: 78 },
{ name: "Mike", age: 27 },
@necolas
necolas / stylesheet-injector.js
Created November 5, 2010 09:49
Create and append style sheets to document <head> using JavaScript
(function() {
var css = [
'/css/default.css',
'/css/section.css',
'/css/custom.css'
],
i = 0,
link = document.createElement('link'),
head = document.getElementsByTagName('head')[0],
tmp;