start new:
tmux
start new with session name:
tmux new -s myname
#include "fixedp.h" | |
#include <iostream> | |
int main(int, char **) | |
{ | |
fixedp<true, 16, 16> x(0); //32-bit signed 16.16 fixed-point number | |
fixedp<false, 8, 8> y(10); //16-bit unsigned 8.8 fixed-point number | |
std::cout << (fixedp<false, 4, 4>(3.5) + fixedp<false, 4, 4>(4.5)).toFloat() << std::endl; | |
//prints "8" |
#!/bin/sh | |
# | |
# Change the commit and/or author date of git commits. | |
# | |
# change-date [-f] commit-to-change [branch-to-rewrite [commit-date [author-date]]] | |
# | |
# If -f is supplied it is passed to "git filter-branch". | |
# | |
# If <branch-to-rewrite> is not provided or is empty HEAD will be used. |
#include <stdio.h> | |
#include <stdint.h> | |
class A { | |
public: | |
virtual void doThing() { | |
printf("I'm an A\n"); | |
} | |
}; |
// 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, |
Whether you're trying to give back to the open source community or collaborating on your own projects, knowing how to properly fork and generate pull requests is essential. Unfortunately, it's quite easy to make mistakes or not know what you should do when you're initially learning the process. I know that I certainly had considerable initial trouble with it, and I found a lot of the information on GitHub and around the internet to be rather piecemeal and incomplete - part of the process described here, another there, common hangups in a different place, and so on.
In an attempt to coallate this information for myself and others, this short tutorial is what I've found to be fairly standard procedure for creating a fork, doing your work, issuing a pull request, and merging that pull request back into the original project.
Just head over to the GitHub page and click the "Fork" button. It's just that simple. Once you've done that, you can use your favorite git client to clone your repo or j
diff --git a/file.c b/file.c | |
index 6faa5a3..e3af329 100644 | |
--- a/file.c | |
+++ b/file.c | |
@@ -1,26 +1,25 @@ | |
#include <stdio.h> | |
-// Frobs foo heartily | |
-int frobnitz(int foo) | |
+int fib(int n) |
diff --git a/file.txt b/file.txt | |
index 3299d68..accc3bd 100644 | |
--- a/file.txt | |
+++ b/file.txt | |
@@ -1,7 +1,7 @@ | |
+abc | |
aaaaaa | |
aaaaaa | |
bbbbbb | |
bbbbbb |
/* | |
After purchasing a humble book bundle, go to your download page for that bundle. | |
Open a console window for the page and paste in the below javascript | |
*/ | |
$('a').each(function(i){ | |
if ($.trim($(this).text()) == 'MOBI') { | |
$('body').append('<iframe id="dl_iframe_'+i+'" style="display:none;">'); | |
document.getElementById('dl_iframe_'+i).src = $(this).data('web'); | |
} | |
}); |
#!/usr/bin/env sh | |
## update.sh - manage a OpenWRT LetsEncrypt https instalation | |
# HOWTO: | |
# - put update.sh in its own directory (like /root/.https) | |
# - run ./update.sh your.domain.com (that domain needs to point to your router) | |
# * this get an issued cert from letsencrypt.org using the webroot verification method | |
# * also installs curl and ca-certificates packages | |
# - use crontab -e; add the line `0 0 * * * "/root/.https/update.sh" >>/root/.https/log.txt 2>&` | |
# * this runs the update every day, logging everything to log.txt | |
# |