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
testing | |
testing |
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
#!/bin/sh | |
# This script was written by Abhi Datt. | |
# This is the script is the result of joint effort of Abhi Datt | |
# Copyright (C) 2009 Abhi Datt |
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
#!/usr/bin/env bash | |
if [ $# -ne 2 ];then | |
echo -n "Usage: $0 directory_name timeout_in_seconds | |
Leave the directory name blank for Current Directory | |
For you lazy pal, I assume timeout as 5 sec and Directory as current | |
Do you want to accept this settings? (Y/n): "; | |
read response | |
if [[ "$response" =~ ^[^yY] ]];then | |
exit 0 |
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
#!/usr/bin/python | |
# ============================================================================= | |
# | |
# Remuco - A remote control system for media players. | |
# Copyright (C) 2006-2010 by the Remuco team, see AUTHORS. | |
# | |
# This file is part of Remuco. | |
# | |
# Remuco is free software: you can redistribute it and/or modify |
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
<?php | |
/* | |
* genurl.php | |
* | |
* Copyright 2010-11 Sayan "Riju" Chakrabarti <[email protected]> | |
* | |
* This program is free software; you can redistribute it and/or modify | |
* it under the terms of the GNU General Public License as published by | |
* the Free Software Foundation; either version 2 of the License, or | |
* (at your option) any later version. |
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
## Source: http://stackoverflow.com/a/1585810/1823866 | |
find /home/www/ -type f -exec \ | |
sed -i 's/subdomainA\.example\.com/subdomainB.example.com/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
// Dependencies | |
var gulp = require('gulp'); | |
var nodemon = require('gulp-nodemon'); | |
var notify = require('gulp-notify'); | |
var livereload = require('gulp-livereload'); | |
// Task | |
gulp.task('server', function() { | |
// listen for changes | |
livereload.listen(); |
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
var validateEmail = function (email) { | |
var re = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/; | |
return re.test(email); | |
} | |
var validateAlphanumeric = function (txt) { | |
var re = /^[a-z0-9]*$/i; | |
return re.test(txt); | |
} |
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
String.prototype.countLetterFreq = function () { | |
return this | |
.split('') | |
.filter(l => l.trim()) | |
.map(l => l.toLowerCase()) | |
.reduce( (acc, cur) => { acc[cur] = (acc[cur] === undefined) ? 1 : acc[cur] + 1; return acc; }, {} ) | |
} | |
// Usage: | |
// > "This is a nice sentence".countLetterFreq() |
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
Object.prototype.isEmpty = function () { | |
return !Object.keys(this) | |
.map(k => this.hasOwnProperty(k), this) // bind the value of `this` for each callback | |
.length | |
} | |
// Usage: | |
// > let obj0 = {} | |
// > let obj1 = {foo: 1, bar: 2} | |
// > obj0.isEmpty() // true |
OlderNewer