Look at LSB init scripts for more information.
Copy to /etc/init.d
:
# replace "$YOUR_SERVICE_NAME" with your service's name (whenever it's not enough obvious)
To remove a submodule you need to: | |
Delete the relevant line from the .gitmodules file. | |
Delete the relevant section from .git/config. | |
Run git rm --cached path_to_submodule (no trailing slash). | |
Commit and delete the now untracked submodule files. |
public static class StringTestHelpers | |
{ | |
public static void ShouldEqualWithDiff(this string actualValue, string expectedValue) | |
{ | |
ShouldEqualWithDiff(actualValue, expectedValue, DiffStyle.Full, Console.Out); | |
} | |
public static void ShouldEqualWithDiff(this string actualValue, string expectedValue, DiffStyle diffStyle) | |
{ | |
ShouldEqualWithDiff(actualValue, expectedValue, diffStyle, Console.Out); |
Look at LSB init scripts for more information.
Copy to /etc/init.d
:
# replace "$YOUR_SERVICE_NAME" with your service's name (whenever it's not enough obvious)
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
// Just before switching jobs: | |
// Add one of these. | |
// Preferably into the same commit where you do a large merge. | |
// | |
// This started as a tweet with a joke of "C++ pro-tip: #define private public", | |
// and then it quickly escalated into more and more evil suggestions. | |
// I've tried to capture interesting suggestions here. | |
// | |
// Contributors: @r2d2rigo, @joeldevahl, @msinilo, @_Humus_, | |
// @YuriyODonnell, @rygorous, @cmuratori, @mike_acton, @grumpygiant, |
HEY: I've turned this into a blog post, which is a little more in depth.
🚨 https://eev.ee/blog/2016/06/04/converting-a-git-repo-from-tabs-to-spaces/ 🚨
#include <stdio.h> | |
#include <unistd.h> | |
#include <sys/mman.h> | |
int AddTwo(int input) { | |
return input + 2; | |
} | |
void patchThisShizzle() { | |
int pageSize = sysconf(_SC_PAGE_SIZE); //size of a page. Smallest unit that |
#!/bin/bash | |
# Sometimes you need to move your existing git repository | |
# to a new remote repository (/new remote origin). | |
# Here are a simple and quick steps that does exactly this. | |
# | |
# Let's assume we call "old repo" the repository you wish | |
# to move, and "new repo" the one you wish to move to. | |
# | |
### Step 1. Make sure you have a local copy of all "old repo" | |
### branches and tags. |
if(NOT HOME) | |
if(WIN32) | |
string(REPLACE "\\" "/" HOME "$ENV{USERPROFILE}") | |
else() | |
set(HOME $ENV{HOME}) | |
endif() | |
endif() | |
### Useful Functions and Macros ### | |
# Prints a list of messages, each one in a new line |
I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!
\