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
| nextid = 0 | |
| # websocketserver takes a path to bind to, optional options object and a callback. | |
| wsserver = websocketserver '/ws', (client) -> | |
| # The callback is called when a client connects, with a handler for the client object. | |
| # The user is responsible for adding ids to the client object if they need them. | |
| client.id = nextid++ | |
| console.log "client #{client.id} connected with websocket version #{client.protocolVersion}" |
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 | |
| $fp = stream_socket_client( "tcp://address:port", $error, $errorstr, 60 ); | |
| if(!$fp){ printf( "%s (%d)", $errorstr, $error ); } | |
| $i = 0; | |
| while($i++ < 100){ | |
| $message = sprintf( "%03d message\n", $i ); | |
| fwrite( $fp, $message ); | |
| print $message; | |
| } |
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 | |
| require("sql.php"); | |
| //确保在连接客户端时不会超时 | |
| set_time_limit(0); | |
| //设置IP和端口号 | |
| $address = 'localhost'; | |
| $port = 2009; |
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 | |
| require("sql.php"); | |
| //确保在连接客户端时不会超时 | |
| set_time_limit(0); | |
| //设置IP和端口号 | |
| $address = 'localhost'; | |
| $port = 2009; |
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 | |
| /** | |
| * IMAP_access. Utility class for processing a mailbox for applications that | |
| * want to grab the body text and do something with it e.g. create a new | |
| * todo list item. Enough clues in there that it can be expanded to do | |
| * a lot more if required - e.g. also grab file attachments. | |
| * | |
| * Based on several part-working tutorials (fixed), the PHP manual examples | |
| * and testing on real email samples from Gmail, Thunderbird and MS outlook 2010. | |
| * (flatten_parts is the tricky bit and was from 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
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8" /> | |
| <title>parseTable</title> | |
| </head> | |
| <body> | |
| <table> | |
| <thead> | |
| <tr> |
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 getTableDataAJAX = function() { | |
| var getTableData = new XMLHttpRequest(); | |
| getTableData.onreadystatechange = function() { | |
| if(getTableData.readyState === 4) { | |
| var tableInfo = JSON.parse(getTableData.responseText); | |
| var tableHeading = tableInfo.tableHeading; | |
| var tableCellsPets = tableInfo.tableCellsPets; | |
| var tableCellsPeople = tableInfo.tableCellsPeople; |
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
| /*************************************************************/ | |
| // NumeroALetras | |
| // The MIT License (MIT) | |
| // | |
| // Copyright (c) 2015 Luis Alfredo Chee | |
| // | |
| // Permission is hereby granted, free of charge, to any person obtaining a copy | |
| // of this software and associated documentation files (the "Software"), to deal | |
| // in the Software without restriction, including without limitation the rights |
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
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta http-equiv="content-type" content="text/html; charset=UTF-8"> | |
| <title>WebKit contentEditable focus bug workaround</title> | |
| <script type='text/javascript' src='http://code.jquery.com/jquery-1.6.2.js'></script> | |
| <script type='text/javascript'> | |
| //<![CDATA[ | |
| $(function(){ |
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
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta http-equiv="content-type" content="text/html; charset=UTF-8"> | |
| <title>WebKit contentEditable focus bug workaround</title> | |
| <script type='text/javascript' src='http://code.jquery.com/jquery-1.6.2.js'></script> | |
| <script type='text/javascript'> | |
| //<![CDATA[ | |
| $(function(){ |
NewerOlder