This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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()); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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 += " "; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
##This example is for Windows OS. | |
1. Create chrome shortcut. | |
2. Go to shortcut properties and add the below to the end of the shortcut target. | |
3. add as many other flags to the end as you need. i.e. --disable-web-security | |
--args --user-data-dir="/tmp/chrome_dev_session" --disable-web-security --ignore-certificate-errors --allow-running-insecure-content | |
or enter... to cmd... | |
"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --args --user-data-dir="/tmp/chrome_dev_session" --disable-web-security --ignore-certificate-errors --allow-running-insecure-content | |
"Put the file location of chrome.exe for your system in the quotes..." --args --user-data-dir="/tmp/chrome_dev_session" --disable-web-security --ignore-certificate-errors --allow-running-insecure-content |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Clamp(x, min, max) { | |
return x < min ? min: (x > max ? max: x); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Author https://github.com/timothy | |
* @return {number} | |
*/ | |
function Factorial(num) { | |
return num <=1 ? 1 : num * Factorial(num - 1); | |
} | |
console.log(Factorial(8)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>DOM Manipulation</title> | |
</head> | |
<body> | |
<script type="text/javascript"> | |
/** | |
* Add new DOM elements |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* this takes in a number and returns | |
* an array of unique random numbers | |
* starting from o to the amount given. | |
* @param {number} amount this is the range and the amount of random numbers | |
* @returns {Array} unique random numbers between 0 and amount | |
*/ | |
function uniquRand(amount) { | |
var uRandA = []; | |
var random = 0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Step by step to create a new app from scratch | |
1. Build simple Requirements doc | |
2. Extract Use Cases from Requirements Doc | |
3. Find Use Case Dependencies. i.e. use case 5 cannot be done until 2 is complete… | |
4. Order Use Cases. Start with the most essential use case that has no dependencies. | |
5. Find all Core use cases. i.e. Adds to the structure of the app and adds data to app. Then find supporting use cases to implement to test… | |
Sketch out User experience. i.e. what will the site look like… |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-g //this means global | |
--save-dev // save to the davDependencies in package.json | |
--save // save to the Dependencies in package.json | |
//find all global packages | |
npm list -g --depth=0 | |
//Install packages for a specific project locally. Install as dev dependency. | |
npm install --save-dev package-name |
NewerOlder