Skip to content

Instantly share code, notes, and snippets.

$(function () {
var $link_modal = $("<a>");
$link_modal
.attr('data-toggle', 'modal')
.attr('data-target', '#datosPersonales')
.attr('data-show', 'true')
.attr('data-backdrop', 'static')
.attr('id', 'modal_action');
@lordn-n
lordn-n / wp-health.sh
Created March 3, 2017 00:36
Script to check wordpress health
#!/bin/bash
# Add cron for this
# 0 * * * * /home/ec2-user/wp-health-check.sh
health="$(curl -s -D - 'http://34.207.228.159/' -o /tmp/last_wp_check)"
if [ "$health" == 'HTTP/1.1 200 OK' ]; then
echo "$(date) - OK" >> /var/log/wp-health
else
echo $health >> /tmp/err_mail
// see http://rodneyrehm.de/t/url-regex.html#imme_emosol for the complete table
// expression by
var url_pattern = /^(https?|ftp|torrent|image|irc|magnet|git\+ssh):\/\/(-\.)?([^\s\/?\.#-]+\.?)+(\/[^\s]*)?$/i;
var valid = [
"http://foo.com/blah_blah",
"http://foo.com/blah_blah/",
"http://foo.com/blah_blah_(wikipedia)",
"http://foo.com/blah_blah_(wikipedia)_(again)",
@lordn-n
lordn-n / js_contextMenu_textSelec
Last active January 14, 2018 10:59
Enable/Disable context menu and text selection
/*
* Deshabilita click derecho (menu contextual)
*/
window.oncontextmenu = function(){
return false;
};
/*
* Habilita click derecho (menu contextual)
*/
@lordn-n
lordn-n / TitaniumStudio Android Holo Style
Created November 11, 2013 23:24
Use Android Holo style with fallback to lower versions in Titanium Studio. Just replace <android xmlns........ line with this and that's it :D
<android xmlns:android="http://schemas.android.com/apk/res/android">
<tool-api-level>17</tool-api-level>
<manifest android:installLocation="preferExternal"
android:versionCode="3" android:versionName="1.0.2">
<uses-sdk android:minSdkVersion="7" android:targetSdkVersion="17"/>
<application android:theme="@android:style/Theme.Holo">
<activity
android:configChanges="keyboardHidden|orientation"
android:name="org.appcelerator.titanium.TiActivity"
android:screenOrientation="portrait"