A Pen by Adam Joiner on CodePen.
This method assumes that a complex problem can be decomposed into discrete modules. Each module’s contribution is computed by multiplying its:
- Activity Indicator (A(M_i)): A value (0–1) denoting how critical the module is.
- Resource Allocation (R(M_i)): The portion of total available resources dedicated to the module, subject to:
[ \sum_{i=1}^{n} R(M_i) \le R_{\text{total}} ]
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> |
NewerOlder