Skip to content

Instantly share code, notes, and snippets.

View savaged's full-sized avatar
418

David Savage savaged

418
View GitHub Profile
@Obsidion
Obsidion / gist:1204800
Created September 8, 2011 21:28
Create bare git repo
---------NO CODE YET--------
on server:
git init --bare
then clone it locally:
git clone git@server:/myNewRepo.git
@fritz0705
fritz0705 / gist:1380828
Created November 20, 2011 20:16
my i3 config on my x220
# This configuration uses Mod1 and Mod3. Make sure they are mapped properly using xev(1)
# and xmodmap(1). Usually, Mod1 is Alt (Alt_L) and Mod3 is Windows (Super_L)
# ISO 10646 = Unicode
font -*-fixed-medium-r-normal-*-13-*-*-*-*-70-iso10646-*
# Use Mouse+Mod1 to drag floating windows to their wanted position
floating_modifier Mod4
# New configuration
@mattratleph
mattratleph / vimdiff.md
Last active July 18, 2024 15:03 — forked from roothybrid7/vimdiff_cheet.md
vimdiff cheat sheet

vimdiff cheat sheet

##git mergetool

In the middle file (future merged file), you can navigate between conflicts with ]c and [c.

Choose which version you want to keep with :diffget //2 or :diffget //3 (the //2 and //3 are unique identifiers for the target/master copy and the merge/branch copy file names).

:diffupdate (to remove leftover spacing issues)

:only (once you’re done reviewing all conflicts, this shows only the middle/merged file)

@rais38
rais38 / gist:5766980
Created June 12, 2013 16:35
Create patch from stash
git stash show -p stash@{0} > Stash0.patch
@ScottLilly
ScottLilly / DeleteQueryWithGrammar.cs
Created October 14, 2013 14:02
Source code for my "How to build a fluent interface in C#" blog post.
using System.Collections.Generic;
using BuildAFluentInterface.Interfaces;
namespace BuildAFluentInterface
{
public class DeleteQueryWithGrammar : ICanAddCondition, ICanAddWhereValue, ICanAddWhereOrRun
{
private readonly string _tableName;
private readonly List<WhereCondition> _whereConditions = new List<WhereCondition>();
@bitwalker
bitwalker / Option.cs
Created July 11, 2014 20:32
Implementation of Option<T> in C#
using System;
namespace Types
{
public static class Option
{
public static Option<T> ToOption<T>(this T @this)
{
if (@this == null)
return Option<T>.None;
@palopezv
palopezv / dwm_config_pulseaudio.h
Last active June 19, 2024 15:52 — forked from neuro-sys/dwmconfig.h
dwm volume control with hardware multimedia keys (pipewire, pulseaudio, amixer and light as an extra)
/**
* dwmconfig.h
* Hardware multimedia keys
*/
/* Somewhere at the beginning of config.h include: */
/*
You obviously need the X11 development packages installed, X11proto in particular, but
here is the location of the keysyms header upstream copy if you can't bother
using the contents of your own hard drive. ;-P
@GeorgDangl
GeorgDangl / MockHttpClient.cs
Last active October 6, 2021 13:47
Mock an Asp.Net Core HttpClient with a custom HttpMessageHandler using Moq
using System;
using System.Net.Http;
using System.Threading;
using System.Threading.Tasks;
using Moq;
using Moq.Protected;
namespace Tests
{
public class MockHttpClient
@doncadavona
doncadavona / Aes256CbcEncrypterApp.cs
Last active October 29, 2023 09:30
A sample C# class to encrypt and decrypt texts using the cipher AES-256-CBC used in Laravel.
using System;
using System.Text;
using System.Security.Cryptography;
using System.Web.Script.Serialization;
using System.Collections.Generic;
namespace Aes256CbcEncrypterApp
{
class MainClass
{
@heroheman
heroheman / ranger-cheatsheet.md
Last active July 19, 2024 17:56
Ranger Cheatsheet

Ranger Cheatsheet

General

Shortcut Description
ranger Start Ranger
Q Quit Ranger
R Reload current directory
? Ranger Manpages / Shortcuts