As configured in my dotfiles.
start new:
tmux
start new with session name:
// | |
// Regular Expression for URL validation | |
// | |
// Author: Diego Perini | |
// Created: 2010/12/05 | |
// Updated: 2018/09/12 | |
// License: MIT | |
// | |
// Copyright (c) 2010-2018 Diego Perini (http://www.iport.it) | |
// |
As configured in my dotfiles.
start new:
tmux
start new with session name:
<html> | |
<head> | |
<title>Google Maps Multiple Markers</title> | |
<script src="http://maps.google.com/maps/api/js?sensor=false" type="text/javascript"></script> | |
</head> | |
<body> | |
<div id="map" style="height: 400px; width: 500px;"> | |
</div> | |
<script type="text/javascript"> |
$("#selectBox").append('<option value="option6">option6</option>'); |
<?php | |
// PHP >= 5.3 | |
// resposta: https://www.facebook.com/groups/nao.tem.biscoito/permalink/10153102397605160/ | |
$required = 282261; | |
$itens = array_filter($seuArray, function($item) use ($required) { | |
return $item[0] == $required; | |
}); |
Block encapsulates a standalone entity that is meaningful on its own.
While blocks can be nested and interact with each other, semantically they remain equal; there is no precedence or hierarchy.
Holistic entities without DOM representation (such as controllers or models) can be blocks as well.
#!/bin/bash | |
# Usage: slackpost <token> <channel> <message> | |
# Enter the name of your slack host here - the thing that appears in your URL: | |
# https://slackhost.slack.com/ | |
slackhost=PUT_YOUR_HOST_HERE | |
token=$1 |
#!/bin/bash | |
# simple function to check http response code before downloading a remote file | |
# example usage: | |
# if `validate_url $url >/dev/null`; then dosomething; else echo "does not exist"; fi | |
function validate_url(){ | |
if [[ `wget -S --spider $1 2>&1 | grep 'HTTP/1.1 200 OK'` ]]; then echo "true"; fi | |
} |
#!/bin/bash | |
#setup variables | |
x="/share/cam" #base dir to search | |
age="1" #minimum age in minutes of file to include in processing | |
date=$(date +"%Y%m%d%H%M") #date used throughout script | |
fileprefix="YT-5010L-" #output file name prefix | |
ytemail="youremail" #your youtube email account | |
ytpassword="password" #your youtube password | |
emailfrom="youremail(Your Name)" #your email address and from name | |
emailuser="youremail" #your gmail address |
#!/bin/bash | |
# This script is used by Nagios to post alerts into a Slack channel | |
# using the Incoming WebHooks integration. Create the channel, botname | |
# and integration first and then add this notification script in your | |
# Nagios configuration. | |
# | |
# All variables that start with NAGIOS_ are provided by Nagios as | |
# environment variables when an notification is generated. | |
# A list of the env variables is available here: |