I use http://mrcoles.com/bookmarklet/ to create my bookmarklets, because it allows you to inject dependencies and such.
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
var _ = require('lodash') | |
, chalk = require('chalk') | |
; | |
var keywordAnalysis = function keywordAnalysis(content, options) { | |
// configure options |
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
/** | |
* Pads the left side of a string to `length` with N `char` characters | |
* @note If the string.length is greater than length, the method will not truncate to length | |
* @param {int} length The length of the desired string result | |
* @param {str} char Character to pad the string with | |
* @return {string} The padded string | |
*/ | |
String.prototype.padLeft = function(length, char) { | |
char = char || ' '; |
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
"testing, waffles 1234567+=-_^@,./;:[]\/".replace(/[+-_]/g, '') | |
// > "testing waffles " |
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
{ | |
cComments: /\/\*[\s\S]*?\*\/|\/\/[\s\S]*?(?=\n)/g | |
, emails: /[\S]+@[\S]+/gi | |
/* EMAIL TEST | |
[email protected] | |
[email protected] | |
[email protected] | |
[email protected] | |
[email protected] | |
*/ |
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 pyramid(rows) { | |
var message = [] | |
, spaces = stars = '' | |
; | |
for (var i = 1; i <= rows; i += 1) { | |
// The (+1) and (*2) in both equations account for Array.join() omitting the | |
// first (0) index when it concatenates our string |
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 stripMoneyFormat(string, currency) { | |
currency = currency || '$'; | |
var regex = { | |
moneys: new RegExp('[\\'+currency+'\,]', 'g') | |
} | |
; | |
if (typeof(string) == "string") { | |
return parseFloat(string.replace(regex.moneys, ''))toFixed(2); |
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
#include <iostream> | |
int main() { | |
std::cout << "Hello World!" << std::endl; | |
std::cin.get(); | |
return 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
#!/bin/sh | |
# | |
# | |
# _____ _ _ _ _ _ _ _ _ | |
# | | |___ _| |___ ___| | | |___| |_| |_|_| |_ | |
# | | | | . | . | -_|___| | | | -_| . | '_| | _| | |
# |_|___|___|___|___| |_____|___|___|_,_|_|_| | |
# | |
# _____ _ _____ _ | |
# | __ |___ ___| |_ | | |___| |___ ___ ___ ___ |
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
<?php | |
class cURL { | |
/** | |
* cURL request method | |
* | |
* @var string | |
*/ | |
protected $_method = 'GET'; |