A Pen by Adam Joiner on CodePen.
This file contains hidden or 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() { | |
$('.login_button').click(function() { | |
doLogin(); | |
}); | |
$('#send_chat_form').submit(function() { | |
var message = $(this).find('.message').val(); | |
sendMsg(message); | |
$('#chat').append('<div class="msg">me: ' + message + '</div>'); | |
$(this).find(".message").val(''); |
This file contains hidden or 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 express = require('express'); | |
var app = express(); | |
var port = 3010; | |
var title = 'Homepage'; | |
var home = '<h1>'+title+'</h1>'; | |
app.get('/', function (req, res) { |
This file contains hidden or 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 | |
/* | |
Template Name: Custom Page Template | |
Author: Adam C. Joiner | |
Note: This template can be utilized by selecting it from the "Page Template" dropdown on the right hand side of the Wordpress page editor screen and then clicking Save. | |
*/ | |
get_header(); | |
/* Page content goes here */ |
This file contains hidden or 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
/* | |
Module Name: LogJS | |
Description: Adds on/off and custom coloring functions to console logs | |
Author: Adam C. Joiner | |
Author URI: http://www.adamcjoiner.com/ | |
Usage: log.on(); // off by default | |
log.post('message') // log to console in white text | |
log.debug('email sent successfully'); // gray text | |
log.info('sending email'); // yellow text | |
log.warning('server responded with no data'); |
This file contains hidden or 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 | |
$user = $_POST['user']; | |
$pass = md5($_POST['pass']); | |
$hash = "enter your md5 hash here"; | |
if($user == "admin" | |
&& $pass == $hash) | |
{ | |
echo "Secure content:"; | |
include("content.html"); |
This file contains hidden or 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
$.ajax({url: "http://www.google.com/", | |
type: "HEAD", | |
timeout:1000, | |
statusCode: { | |
200: function (response) { | |
console.log('Status 200: Page is up!'); | |
}, | |
400: function (response) { | |
console.log('Status 400: Page is down.'); | |
}, |
This file contains hidden or 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 | |
// enqueue these scripts and styles before admin_head | |
wp_enqueue_script( 'jquery-ui-dialog' ); // jquery and jquery-ui should be dependencies, didn't check though... | |
wp_enqueue_style( 'wp-jquery-ui-dialog' ); | |
?> | |
<!-- The modal / dialog box, hidden somewhere near the footer --> | |
<div id="my-dialog" class="hidden" style="max-width:800px"> | |
<h3>Dialog content</h3> | |
<p>This is some terribly exciting content inside this dialog. Don't you agree?</p> |
This file contains hidden or 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
$('#btn-animate').click(function() { | |
// Shake the 'Codes' dropdown | |
animEl = $('#dropdown-codes'); | |
animEl.addClass('shake animated'); // ~add the anim. CSS class | |
animEl.one('webkitAnimationEnd oanimationend msAnimationEnd animationend', function (e) { | |
animEl.removeClass('shake animated'); // ~remove it when finished | |
}); | |
}); |
This file contains hidden or 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
/* | |
Found on StackOverflow: | |
iPhone Safari Web App opens links in new window | |
https://stackoverflow.com/questions/2898740/iphone-safari-web-app-opens-links-in-new-window | |
I have problem with web after adding icon to Home Screen. If the web is launched from Home Screen, all links will open in new window in Safari (and lose full screen functionality). How can I prevent it? I couldn't find any help, only the same unanswered question. | |
ANSWER: |
NewerOlder