This file contains 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
@echo off | |
SET st2Path=C:\Program Files\Sublime Text 2\sublime_text.exe | |
rem add it for all file types | |
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 2" /t REG_SZ /v "" /d "Open with Sublime Text 2" /f | |
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 2" /t REG_EXPAND_SZ /v "Icon" /d "%st2Path%,0" /f | |
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 2\command" /t REG_SZ /v "" /d "%st2Path% \"%%1\"" /f | |
rem add it for folders | |
@reg add "HKEY_CLASSES_ROOT\Folder\shell\Open with Sublime Text 2" /t REG_SZ /v "" /d "Open with Sublime Text 2" /f |
This file contains 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
// Bonfire: Factorialize a Number | |
// Author: @piqueen314 | |
// Challenge: http://www.freecodecamp.com/challenges/bonfire-factorialize-a-number | |
// Learn to Code at Free Code Camp (www.freecodecamp.com) | |
function factorialize(num) { | |
var fac=1; | |
if (num ===0){ | |
return fac; | |
} |
This file contains 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
// Bonfire: Check for Palindromes | |
// Author: @piqueen314 | |
// Challenge: http://www.freecodecamp.com/challenges/bonfire-check-for-palindromes | |
// Learn to Code at Free Code Camp (www.freecodecamp.com) | |
function palindrome(str) { | |
// Good luck! | |
str=str.toLowerCase(); | |
str=str.replace(/\W/g,"").replace(/[_]/g,""); | |
This file contains 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
// Bonfire: Find the Longest Word in a String | |
// Author: @piqueen314 | |
// Challenge: http://www.freecodecamp.com/challenges/bonfire-find-the-longest-word-in-a-string | |
// Learn to Code at Free Code Camp (www.freecodecamp.com) | |
function findLongestWord(str) { | |
var words=str.split(" "); | |
var max=0; | |
for (var i=0; i < words.length; i++) | |
{ |
This file contains 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
// Bonfire: Title Case a Sentence | |
// Author: @piqueen314 | |
// Challenge: http://www.freecodecamp.com/challenges/bonfire-title-case-a-sentence | |
// Learn to Code at Free Code Camp (www.freecodecamp.com) | |
function titleCase(str) { | |
var words=str.split(" "); | |
for(var i=0; i<words.length; i++) | |
{ | |
words[i]=words[i].toLowerCase(); |
This file contains 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
// Bonfire: Return Largest Numbers in Arrays | |
// Author: @piqueen314 | |
// Challenge: http://www.freecodecamp.com/challenges/bonfire-return-largest-numbers-in-arrays | |
// Learn to Code at Free Code Camp (www.freecodecamp.com) | |
function largestOfFour(arr) { | |
// You can do this! | |
var newArr=[]; |
This file contains 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
// Bonfire: Confirm the Ending | |
// Author: @piqueen314 | |
// Challenge: http://www.freecodecamp.com/challenges/bonfire-confirm-the-ending | |
// Learn to Code at Free Code Camp (www.freecodecamp.com) | |
function end(str, target) { | |
// "Never give up and good luck will find you." | |
// -- Falcor | |
lenStr=str.length; | |
lenTar=target.length; |
This file contains 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
// Bonfire: Repeat a string repeat a string | |
// Author: @piqueen314 | |
// Challenge: http://www.freecodecamp.com/challenges/bonfire-repeat-a-string-repeat-a-string | |
// Learn to Code at Free Code Camp (www.freecodecamp.com) | |
function repeat(str, num) { | |
// repeat after me | |
var newStr=""; | |
for(var i=0; i<num; i++){ | |
newStr=newStr.concat(str); |
This file contains 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
// Bonfire: Truncate a string | |
// Author: @piqueen314 | |
// Challenge: http://www.freecodecamp.com/challenges/bonfire-truncate-a-string | |
// Learn to Code at Free Code Camp (www.freecodecamp.com) | |
function truncate(str, num) { | |
// Clear out that junk in your trunk | |
if(num <=3) | |
{ | |
return str.slice(0,num)+"..."; |
This file contains 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
// Bonfire: Chunky Monkey | |
// Author: @piqueen314 | |
// Challenge: http://www.freecodecamp.com/challenges/bonfire-chunky-monkey | |
// Learn to Code at Free Code Camp (www.freecodecamp.com) | |
function chunk(arr, size) { | |
var newArr = []; | |
for (var i=0; i < arr.length; i+=size) | |
newArr.push(arr.slice(i,i+size)); | |
return newArr; |
OlderNewer