Skip to content

Instantly share code, notes, and snippets.

Business Models

Advertising

Models Examples
Display ads Yahoo!
Search ads Google
@ArnonEilat
ArnonEilat / nice-to-have-bashrc.sh
Last active March 8, 2020 14:27
Nice to have bashrc shortcuts to copy and paste
Black="$(tput setaf 0)"
BlackBG="$(tput setab 0)"
DarkGrey="$(tput setaf 0)"
LightGrey="$(tput setaf 7)"
LightGreyBG="$(tput setab 7)"
White="$(tput setaf 7)"
Red="$(tput setaf 1)"
RedBG="$(tput setab 1)"
LightRed="$(tput setaf 1)"
Green="$(tput setaf 2)"
Boolean.prototype.toggle = function() {
return !this.valueOf();
}
/**
* @description Parses mixed type values into booleans.
* @param {Mixed} value
* @param {Boolean} nullOnFailure = false
* @return {Boolean}
*/
Boolean.prototype.toBoolean: function(obj) {
@ArnonEilat
ArnonEilat / backup.sh
Last active December 21, 2019 20:49
Backup using rsync
#!/bin/bash
ex=''
ex=$ex" --exclude /media/userName/07174FCC5FED4B6F "
ex=$ex" --exclude .adobe "
ex=$ex" --exclude .cordova "
ex=$ex" --exclude .android "
ex=$ex" --exclude android-sdk-linux "
ex=$ex" --exclude tmp "
ex=$ex" --exclude .thumbnails "
@ArnonEilat
ArnonEilat / Gruntfile.js
Created February 6, 2016 12:50
Watch files for changes and copy to other destination
var pathToWatch = 'C:\\Users\\Arnon\\Downloads\\'; // Exploit!!
var copyTo = 'C:\\Users\\Arnon\\Desktop\\tst';
module.exports = function(grunt) {
/**
* Initialize grunt
*/
grunt.initConfig({
watch: {
var docCookies = {
getItem: function (sKey) {
if (!sKey) { return null; }
return decodeURIComponent(document.cookie.replace(new RegExp("(?:(?:^|.*;)\\s*" + encodeURIComponent(sKey).replace(/[\-\.\+\*]/g, "\\$&") + "\\s*\\=\\s*([^;]*).*$)|^.*$"), "$1")) || null;
},
setItem: function (sKey, sValue, vEnd, sPath, sDomain, bSecure) {
if (!sKey || /^(?:expires|max\-age|path|domain|secure)$/i.test(sKey)) { return false; }
var sExpires = "";
if (vEnd) {