Skip to content

Instantly share code, notes, and snippets.

View timothy's full-sized avatar
🎯
Focusing

Timothy timothy

🎯
Focusing
View GitHub Profile
@timothy
timothy / HTML View of Console.log output
Created April 19, 2017 20:10
show console output on web page
<pre id="log"></pre>
<script>
(function() {
var old = console.log;
var logger = document.getElementById('log');
console.log = function() {
for (var i = 0; i < arguments.length; i++) {
if (i > 0) {
logger.innerHTML += " ";
}
sudo apt-get update # Fetches the list of available updates
sudo apt-get upgrade # Strictly upgrades the current packages
sudo apt-get dist-upgrade # Installs updates (new ones)
sudo apt autoremove # Removes unused packages
google-chrome --disable-web-security
chromium-browser --disable-web-security --user-data-dir
//for caching git credentials...
git config --global credential.helper 'cache --timeout 3600'
@timothy
timothy / Count in a Circle Loop
Created July 12, 2017 11:29
circular count within a loop
//circular count within a loop example
std::string key = "12345";
for (int i = 0, j = 0; i < 30; ++i)
{
std::cout << j;
j = (int) ((j + 1) % key.length());
}