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
| <script> | |
| try { | |
| var source = new EventSource('/stream'); | |
| source.addEventListener('tick', function ( evt ) { | |
| console.log(evt.data); | |
| }); | |
| } | |
| catch ( e ) { |
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 | |
| class Hasher | |
| { | |
| private static $_pepper = 'Bh7ly%NX*3OY12%zd50amb$bizad%pxln*3a5q'; | |
| /** | |
| * @param plain pass | string generated from bcrypt_salt() method | |
| * @return string | |
| */ |
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 | |
| namespace Utils; | |
| use Config; | |
| class SecurityUtils { | |
| /** | |
| * @param string $string: string to encrypt or decrypt |
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 | |
| // uncomment the following two lines, if you don't use composer | |
| require 'vendor/handlebars.php-0.10.4/src/Handlebars/Autoloader.php'; | |
| // require 'vendor/handlebars.php-master/src/Handlebars/Autoloader.php'; | |
| Handlebars\Autoloader::register(); | |
| use Handlebars\Handlebars; |
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> | |
| <title></title> | |
| </head> | |
| <body> | |
| <div id="macro-1"> | |
| Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod | |
| tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, | |
| {{extra_contents}} |
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_once('HttpResponse.php'); | |
| class HttpRequest { | |
| /** | |
| * The url which will be requested | |
| * @var string | |
| */ |
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
| server { | |
| listen 80; | |
| server_name laravel-project.local; | |
| root /vagrant/code/laravel-project/public; | |
| index index.php index.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
| <?php | |
| # Note that 8080 is the port to my Node.js server - you may want to change. | |
| function sio_message($message, $data) { | |
| $socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP); | |
| $result = socket_connect($socket, '127.0.0.1', 8080); | |
| if(!$result) { | |
| die('cannot connect '.socket_strerror(socket_last_error()).PHP_EOL); | |
| } | |
| $bytes = socket_write($socket, json_encode(Array("msg" => $message, "data" => $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
| .select2-selection__rendered { | |
| line-height: 31px !important; | |
| } | |
| .select2-container .select2-selection--single { | |
| height: 35px !important; | |
| } | |
| .select2-selection__arrow { | |
| height: 34px !important; |
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
| fetch('http://mydomain.local/api/photo', { | |
| method: 'POST', | |
| mode: 'cors', | |
| headers: { | |
| 'Content-Type': 'application/json' | |
| }, | |
| body: JSON.stringify({'lat': 12121, lng: 1212121, title: 'dasdasdsa', 'image': 'data:image/jpeg;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNkYPj/HwADBwIAMCbHYQAAAABJRU5ErkJggg=='}) | |
| }).then(res => { | |
| console.log('res', res); | |
| }).catch(err => { |
OlderNewer