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 <stdio.h> | |
#include <string.h> | |
#include <ctype.h> | |
#include <stdlib.h> | |
char* randomizeCase(char *str) { | |
int i = 0; | |
char* new_str; | |
new_str = ""; | |
while (str[i]) |
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
########## | |
# Win10 Initial Setup Script | |
# Author: Disassembler <disassembler@dasm.cz> | |
# Version: 1.7, 2016-08-15 | |
# dasm's script: https://github.com/Disassembler0/Win10-Initial-Setup-Script/ | |
# THIS IS A PERSONALIZED VERSION | |
# This script leaves more MS defaults on, including MS security features. | |
# Tweaked based on personal preferences for @alirobe 2016-11-16 - v1.7.1 |
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
user: nobody | |
hosts: | |
"foo.example.com:443": | |
listen: | |
host: 0.0.0.0 | |
port: 443 | |
ssl: | |
certificate-file: /etc/pki/tls/certs/foo.example.com-2015.crt | |
key-file: /etc/pki/tls/certs/foo.example.com-2015.key | |
minimum-version: TLSv1 |
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 | |
function cenerateDummyIdCode() { | |
$multiplier = [ | |
[1, 2, 3, 4, 5, 6, 7, 8, 9, 1], | |
[3, 4, 5, 6, 7, 8, 9, 1, 2, 3], | |
]; | |
// get random date from 1970-01-28 to 1990-01-28 | |
$birthday = mt_rand(2382512, 633534512); |
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
// not tested by me | |
// from http://valgeklaar.ee/js/lib/ccard.js | |
// Credit Card Validation Javascript | |
// copyright 12th May 2003, by Stephen Chapman, Felgall Pty Ltd | |
// You have permission to copy and use this javascript provided that | |
// the content of the script is not changed in any way. |
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
angular.module('app').directive('strongSecret', function() { | |
return { | |
// limit usage to argument only | |
restrict: 'A', | |
// require NgModelController, i.e. require a controller of ngModel directive | |
require: 'ngModel', | |
// create linking function and pass in our NgModelController as a 4th argument |
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
# (Re)create the index | |
curl -X DELETE "http://localhost:9200/tagcloud" | |
curl -X PUT "http://localhost:9200/tagcloud"-d '{ | |
"settings" : { | |
"index" : { | |
"number_of_shards" : 1, | |
"number_of_replicas" : 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
str.replace(/o/gi, "0").replace(/l/g, "1").replace(/\+/i, "-").replace(/s/gi, "5").replace(/t/gi, "7").replace(/i/gi, "1").replace(/a/gi, "4").replace(/e/gi, "3") |
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
/** | |
* Checks, if slug exists in database, if so, it adds number after it | |
* @param {String} pretty_slug | |
* @return {Promise} when resolved, gets valid slug | |
*/ | |
validateSlug: function(pretty_slug) { | |
return PrettyUrls.findByPrettySlug(pretty_slug) | |
.then(function(slug) { | |
var newSlug = prettyurls._addNumberToSlug(pretty_slug); | |
return prettyurls.validateSlug(newSlug); |
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
// from http://stackoverflow.com/questions/6251463/regex-capitalize-first-letter-every-word-also-after-a-special-character-like-a | |
var re = /(\b[a-z](?!\s))/g; | |
var s = "fort collins, croton-on-hudson, harper's ferry, coeur d'alene, o'fallon, MARI-ANN, KARL BRT TUAS"; | |
s = s.toLowerCase().replace(re, function(x){return x.toUpperCase();}); | |
console.log(s); // "Fort Collins, Croton-On-Hudson, Harper's Ferry, Coeur D'Alene, O'Fallon" |
NewerOlder