Skip to content

Instantly share code, notes, and snippets.

View rick4470's full-sized avatar

Rick rick4470

View GitHub Profile
@rick4470
rick4470 / ng-app
Created July 17, 2015 02:22
angular app gists
<body ng-app>
....
</body>
@rick4470
rick4470 / cli-images
Created July 17, 2015 20:06
Create images with CLI
ffmpeg -i video_name.mp4 -r 2.0 output_%04d.png
@rick4470
rick4470 / coin_problem.js
Last active August 29, 2015 14:26
Coin Problem
var input = 89,
quarterCount = 0,
dimeCount = 0,
nickleCount = 0,
plural = '';
if (input > 99 || input < 1) {
console.log('Invalid amount, please select a value between (1-99)');
}else{
while(input >= 25){
@rick4470
rick4470 / game of life.js
Last active August 29, 2015 14:26
Game of Life in javascript
var grid = initGrid(30, 30);
printGrid(grid);
startGame();
function startGame() {
(function generation(generations) {
setTimeout(function() {
var tempGrid = initGrid(30, 30);
@rick4470
rick4470 / game_of_life_functional.js
Last active August 29, 2015 14:26
game of life functional
var grid = initGrid(30, 30, 10);
printGrid(grid);
startGame();
function startGame() {
(function generation(generations) {
setTimeout(function() {
var tempGrid = initGrid(30, 30, 10);
@rick4470
rick4470 / brackets.js
Created August 7, 2015 22:00
Brackets Shortcuts
⌘⇧E Open working files list
CTRL+TAB Iterates over windows
⌘ + B selects multiple items
@rick4470
rick4470 / e-value.js
Last active October 23, 2017 08:28
Calculating e (mathematical constant) with javascript
var eValue = 0;
for(var i=0; i< Infinity; i++){
if(i==18) break;
var fact = 1;
for(var j=1; j<= i; j++){
fact = fact * j;
}
eValue += (1/fact);
}
console.log(eValue);
@rick4470
rick4470 / pet_store.js
Last active August 29, 2015 22:52
Programming Challenge: Object Oriented Pet Store
/* Animal */
var Animal = function () {
var name,
type;
};
Animal.prototype.toString = function (type, location) {
return "A " + type + " moves along the " + location;
};
@rick4470
rick4470 / mount_smbfs.sh
Last active September 5, 2015 03:35 — forked from natritmeyer/mount_smbfs.sh
How to mount and unmount a SMB share on Mac OS X (using mount_smbfs)
#Mounting the share is a 2 stage process:
# 1. Create a directory that will be the mount point
# 2. Mount the share to that directory
#Create the mount point:
mkdir share_name
#Mount the share:
mount_smbfs //username:[email protected]/share_name share_name/
@rick4470
rick4470 / sample.js
Last active March 3, 2016 01:57
Creating a new NodeJS Project
mkdir channel && cd channel
npm init
git init
echo "node_modules" >> .gitignore
echo "*.xml" >> .gitignore
npm install xml2js --save
vim app.js