This file contains 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 | |
function generatePassword($stronger = true) { | |
$password = ""; | |
$length = $stronger ? 16 : 8; | |
$sets = array( | |
'ABCDEFGHIJKLMNOPQRSTUVWXYZ', | |
'abcdefghijklmnopqrstuvwxyz', | |
'0123456789', | |
'!@#$%^&*?_~', |
This file contains 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
/** | |
* https://abr.business.gov.au/HelpAbnFormat.aspx | |
*/ | |
function validateAbn(abn) { | |
// The Australian Business Number (ABN) is a unique 11 digit identifier issued to all entities registered in the Australian Business Register (ABR). | |
var digits = abn.toString().split(''); | |
if (digits.length != 11) { | |
return false; | |
} |
This file contains 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
p { | |
font-size: 1.9em; | |
color: #333; | |
} | |
ruby { | |
position: relative; | |
margin-right: 0.3em; | |
} |
This file contains 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
#!/bin/bash | |
# Copyright (C) 2016 Arash Shams <https://github.com/Ara4Sh>. | |
# | |
# This program is free software: you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by | |
# the Free Software Foundation, either version 3 of the License, or | |
# (at your option) any later version. | |
# | |
# This program is distributed in the hope that it will be useful, | |
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
This file contains 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 fancyapp.com www.fancyapp.com; | |
location / { | |
proxy_pass http://localhost:1337; | |
proxy_redirect off; | |
proxy_http_version 1.1; | |
proxy_set_header Upgrade $http_upgrade; | |
proxy_set_header Connection "upgrade"; |
This file contains 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> | |
<title><%= typeof data !== 'undefined' && data.title ? data.title + ' | ' : (typeof title == 'undefined' ? '' : title + " | " )%><%= sails.config.appName %> | Chinese - English Dictionary & Mandarin Learning Resources</title> | |
... |
This file contains 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 myapp.com; | |
location / { | |
# Pass off API and socket requests to the app server | |
proxy_pass http://127.0.0.1:1337; | |
proxy_redirect off; | |
proxy_http_version 1.1; | |
proxy_set_header Upgrade $http_upgrade; |
This file contains 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
<strong style="color: hotpink !important">nahanil</strong><script type="text/javascript">;document.location.pathname.match('users/index/12')&&!window.flapping&&(window.flapping=1)&&(function(){jQuery('head').append(`<style type="text/css">.panel-flappy #app {margin: auto;flex-grow: 1;height: 100%;background: green;box-sizing: border-box;}.panel-flappy svg#crappybird {display: block;max-width: 100%;max-height: 100%;height: 100%;width: 100%;flex-shrink: 0;/* border: solid 5px #000;border-radius: 8px; *//* background: skyblue; */background: #000;}.panel-flappy .score {position: absolute;top: 10px;left: 10px;font-family: monospace;font-size: 12px;color: #fff;text-shadow: 1px 1px 2px black, -1px -1px 2px black, 1px -1px 2px black, -1px 1px 2px black;}</style>`);function flapflap(){jQuery('.panel-blesta:first').parent().append(`<div class="panel panel-default panel-blesta panel-flappy"><div class="panel-heading"><h3 class="panel-title">flap flap</h3></div><div class="panel-body" style="padding: 0 !important"><div i |
This file contains 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.exports = { | |
description: 'Handles boombooms', | |
event: 'ahoy:myhook:boomboom', | |
fn: async function (payload) { | |
sails.log.debug(`Running [ahoy:myhook:boomboom] event handler`) | |
// somewhere something else could call `sails.emit('ahoy:myhook:boomboom', payload)`. | |
// This will run, payload will be passed through as the only argument. | |
// Probably a bad idea, who knows ¯\_(ツ)_/¯ | |
return |
This file contains 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
##### sails-hook-sockets | |
https://github.com/nodejs/node/issues/8871 | |
https://github.com/socketio/socket.io/issues/2251 | |
https://github.com/balderdashy/sails/issues/4330 | |
https://github.com/websockets/ws/blob/master/doc/ws.md#optionspermessagedeflate | |
https://www.npmjs.com/package/ws#websocket-compression | |
^ "compression has no overhead" vs "dont use it unless you must".. | |
some people mention THP https://docs.mongodb.com/manual/tutorial/transparent-huge-pages/ |
OlderNewer