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 result = {}; | |
"Your String".toUpperCase().split(" ").join("").split("").forEach(function(element, index, array) { | |
result[element] = (result[element] + 1 || 1) | |
}); | |
console.log(result); | |
// You can remove '.join("").split("")' to calculate words occurence |
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
#import "UITextFieldNumber.h" | |
@implementation UITextFieldNumber | |
- (void)awakeFromNib | |
{ | |
[self createKeyboardToolbar]; | |
} | |
- (void)createKeyboardToolbar |
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
using System; | |
using System.Collections.Generic; | |
using System.DirectoryServices.AccountManagement; | |
using System.Linq; | |
using System.Security.Principal; | |
namespace console | |
{ | |
class MainClass | |
{ |
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() { | |
var currentScenario = ""; | |
var executedTests = 0; | |
var successTests = 0; | |
var errorTests = 0; | |
var Scenario = function(text) { | |
self.Steps.Before(); | |
currentScenario = text; |
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
private static string RunShellCommand(string command) | |
{ | |
var arguments = "/C " + command; | |
var proccessSettings = new ProcessStartInfo("cmd.exe", arguments) | |
{ | |
WindowStyle = ProcessWindowStyle.Hidden, | |
RedirectStandardOutput = true, | |
UseShellExecute = false, | |
CreateNoWindow = true | |
}; |
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
$(document).on("click", ".modal", function() { | |
$(".modal-view").remove(); | |
var imageSrc = $(this).attr("href"); | |
var image = $("<img>").attr("src", imageSrc).attr("style", "box-shadow: 0 0 40px #000"); | |
var modal = $("<div class='modal-view'>").attr("style","position: fixed; padding-top: 50px; top: 0; bottom: 0; left: 0; right: 0; z-index: 10; text-align: center; background: rgba(0, 0, 0, 0.5);"); | |
modal.html(image) | |
.appendTo("body"); |
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 | |
formail -D 1000000 idcache < $1 -s > $1.tmp && mv $1.tmp $1 | |
rm idcache |
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
wget -HELkpr http://website/ |
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 mkdosfs /dev/mmcblk0 -F32 -s32 |