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
/** | |
* jQuery typingFinished plugin. Fire a callback function when the user is finished typing. | |
* @param timeout The timeout in milliseconds per interval. | |
* @param callback The callback function to fire when the user finishes typing. | |
* @return Object | |
* | |
* Example: | |
* $('input').typingFinished(500, function(e) { | |
* console.log('Done typing. Last key pressed: '+ e.keyCode); | |
* }); |
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
/** | |
* jQuery validatePassword plugin. Fire a callback function if the password passes the test or if it fails the tests. | |
* @param expressions Object with a key => value pair of label => regex expression. | |
* @param success_callback Function the callback to fire when the user passes all of the tests. | |
* @param error_callback Function the callback to fire when the user fails any of the tests. | |
* @return Object | |
* | |
* Example: http://jsfiddle.net/WXqUZ/5/ | |
* $('input[type=password]').validatePassword({ | |
* 'Uppercase': /([A-Z]+)/, |
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
package main | |
import ( | |
"fmt" | |
"strconv" | |
"net/http" | |
"io/ioutil" | |
) | |
const ( |
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 | |
/** | |
* | |
*/ | |
App::uses('UserEDM', 'Entity'); | |
use Facebook\GraphObject; | |
class UserAssembler implements EntityAssembler { | |
const FB_FIRST_NAME = 'first_name'; |
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 http = require('http'); | |
var app = express(); | |
// Simple user controller implementation. | |
var users = [ | |
{ username: 'jamsesso', age: 20, gender: 'M' }, | |
{ username: 'bettycrocker', age: 20, gender: 'F' } | |
]; |
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
void outchar(char ch) { | |
volatile int* JTAG_UART = (int*) 0x00008840; | |
*JTAG_UART = ch; // Write char to display. | |
} | |
char bin2hex(char hex) { | |
hex &= 0x0F; // Mask last 4 bits. | |
return hex <= 9 ? hex + '0' : hex - 10 + 'A'; | |
} |
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
create_signature(payload, type, timestamp, public_key, secret_key) { | |
signature = sprintf("payload=%s&public_key=%s×tamp=%s&type=%s", | |
url_encode(payload), | |
url_encode(public_key), | |
url_encode(timestamp), | |
url_encode(type)) | |
return hmac_sha256(signature, secret_key) | |
} |
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
authenticate_message(message) { | |
secret_key = get_secret_key(message.public_key) | |
my_signature = sprintf("payload=%s&public_key=%s×tamp=%s&type=%s", | |
url_encode(message.payload), | |
url_encode(message.public_key), | |
url_encode(message.timestamp), | |
url_encode(message.type)) | |
return hmac_sha256(my_signature, secret_key) == message.signature | |
} |
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
import com.google.gson.Gson; | |
import java.util.Date; | |
import lombok.Data; | |
import com.google.common.collect.Maps; | |
import java.util.Map; | |
/** | |
* The message class. | |
* This class should be present on both the client as well as the receiving app. | |
* You can serialize this class to send it over the network. JSON is a good choice. |
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 path = require('path'); | |
var webpackConfig = require('./webpack.config'); | |
var webpack = require('webpack'); | |
var webpackDevMiddleware = require('webpack-dev-middleware'); | |
var webpackHotMiddleware = require('webpack-hot-middleware'); | |
var proxyMiddleware = require('http-proxy-middleware'); | |
var devConfig = webpackConfig.devServer; | |
var app = express(); |