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 python | |
# sample usage: checksites.py eriwen.com nixtutor.com yoursite.org | |
import pickle, os, sys, logging | |
from httplib import HTTPConnection, socket | |
from smtplib import SMTP | |
def email_alert(message, status): | |
fromaddr = 'you@gmail.com' |
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 | |
function strip_word_html($text, $allowed_tags = '<b><i><sup><sub><em><strong><u><br><p><div><img>') | |
{ | |
mb_regex_encoding('UTF-8'); | |
//replace MS special characters first | |
$search = array('/‘/u', '/’/u', '/“/u', '/”/u', '/—/u'); | |
$replace = array('\'', '\'', '"', '"', '-'); | |
$text = preg_replace($search, $replace, $text); | |
//make sure _all_ html entities are converted to the plain ascii equivalents - it appears | |
//in some MS headers, some html entities are encoded and some aren't |
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
######################### | |
# | |
# NODE.JS app running in Apache | |
# sample .htaccess - partialy based on vielhuber/.htaccess | |
# Also rules to enforce www. prefix and https: SSL access | |
# | |
# This file must be on the dir where Apache expects to find the website | |
# The Node App can be anywhere else but must be accessible as explained below. | |
# |
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
!function(d,s,id){ | |
var js, | |
fjs=d.getElementsByTagName(s)[0], | |
p='https'; | |
js=d.createElement(s); | |
js.id=id; | |
js.src=p+"://platform.twitter.com/widgets.js"; | |
fjs.parentNode.insertBefore(js,fjs); | |
} | |
(document,"script","twitter-wjs"); |
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
//======================================= | |
// CHECK TC ID = | |
//======================================= | |
var checkTcNum = function(value) { | |
value = value.toString(); | |
var isEleven = /^[0-9]{11}$/.test(value); | |
var totalX = 0; | |
for (var i = 0; i < 10; i++) { | |
totalX += Number(value.substr(i, 1)); | |
} |
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
function vergikimlik(kno) { | |
var v1 = 0; | |
var v2 = 0; | |
var v3 = 0; | |
var v4 = 0; | |
var v5 = 0; | |
var v6 = 0; | |
var v7 = 0; | |
var v8 = 0; | |
var v9 = 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
<?php | |
/** | |
* ----------------------------------------------------------------------------------------- | |
* Based on `https://github.com/mecha-cms/mecha-cms/blob/master/system/kernel/converter.php` | |
* ----------------------------------------------------------------------------------------- | |
*/ | |
// HTML Minifier | |
function minify_html($input) { |
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
/** | |
* Created by shahartaite on 12/09/2016. | |
*/ | |
const winston = require('winston'); | |
const logzioWinstonTransport = require('winston-logzio'); | |
const loggerOptions = { | |
token: 'YOUR_TOKEN', | |
host: 'listener.logz.io', | |
type: 'nodejs' // if you integrate any other services with logz.io such | |
// as your clientside logs you can differentiate using this property |
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
Total props to Brian Cray: http://briancray.com/posts/estimated-reading-time-web-design/ |
NewerOlder