Skip to content

Instantly share code, notes, and snippets.

@thetallweeks
thetallweeks / 3-LongestWord.js
Last active December 26, 2015 12:19
Coderbyte Longest Word in a string
function LongestWord(sen) {
longest = "";
// code goes here
var words = sen.split(" ");
for(i = 0; i < words.length; i++) {
if(words[i].length > longest.length) {
longest = words[i];
}
}
return longest;
@thetallweeks
thetallweeks / 2-FirstFactorial.js
Last active December 26, 2015 12:19
Coderbyte Factorial function
function FirstFactorial(num) {
var factorial = 1;
// code goes here
for(i = 2; i <= num; i++) {
factorial *= i;
}
return factorial;
}
@thetallweeks
thetallweeks / 1-FirstReverse.js
Last active December 26, 2015 09:48
Coderbyte Reverse string Challenge
// http://coderbyte.com/CodingArea/GuestEditor.php?ct=First%20Reverse&lan=JavaScript
function FirstReverse(str) {
var string = [];
for(i = 0; i <= str.length; i++) {
string[i] = str[str.length - i];
}
// code goes here
return string.join("");
}
@thetallweeks
thetallweeks / text-sources
Last active December 25, 2015 22:49
Sublime Text 2 Sources
ActionScript: source.actionscript.2
AppleScript: source.applescript
ASP: source.asp
Batch FIle: source.dosbatch
C#: source.cs
C++: source.c++
Clojure: source.clojure
CoffeeScript: source.coffee
CSS: source.css
D: source.d
@thetallweeks
thetallweeks / CSSComb Alphabetical (Sublime Text 2)
Last active December 16, 2015 06:39
Paste this in user settings to reorder css alphabetically. There are some exceptions - notably I follow shorthand and order padding-top, padding-right, padding-bottom, and padding-left (even though this is not alphabetical). I also kept the prefixed items next to each other.
{
"custom_sort_order": true,
"sort_order": [
"-webkit-animation",
"-moz-animation",
"-ms-animation",
"-o-animation",
"animation",
"-webkit-animation-name",
"-moz-animation-name",