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
Current TPS: 0 | |
Current TPS: 0 | |
Current TPS: 0 | |
Current TPS: 0 | |
Current TPS: 0 | |
Current TPS: 17 | |
Current TPS: 1 | |
Current TPS: 0 | |
Current TPS: 0 | |
Current TPS: 0 |
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
/** | |
Generate a password digest for SOAP authentication. | |
Returns an object with a passwordDigest (Base64), nonce (Base64), and created property. | |
@param string password - | |
@return { passwordDigest: string, nonce: string, created: string } | |
*/ | |
function generatePasswordDigest(password) { | |
// Generate nonce from random bytes | |
var random = java.security.SecureRandom.getInstance("SHA1PRNG"); |
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
// For context, we have two arrays of routes (['get', '/', ...], ['put', '/:id', ...]) that we are checking for collisions | |
// Then removing the collisions from the base array (actions) | |
// #1 | |
// Remove conflicting routes by filtering out items from the base actions where the first 2 values are equal. Coerce the result of find() to a boolean. | |
actions = actions.filter(a => !actions2.find(a2 => a[0].toLowerCase() === a2[0].toLowerCase() && a[1].toLowerCase() === a2[1].toLowerCase())); | |
// #2 | |
actions = actions.filter(a => { | |
// Search the new actions for a case insensitive match. Coerce the result to boolean, and return the inverse. |
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
public function launchWidget($oAuthToken) | |
{ | |
// .. Redacted lots of code | |
$loyaltyIoJwt = $this->loyaltyIoService->createJwt(['user' => $laravelUser->id, 'scopes' => ['**']]); | |
return view('pages.loyalty.widget', [ | |
'jwt' => $loyaltyIoJwt, | |
]); | |
} |
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
$variable = static::where('name', $name) | |
->whereHas('widget', function ($q) use ($widget) { | |
$q->where('name', $widget); | |
}) | |
->first(); | |
return $variable ? : 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
<?php | |
namespace App\Extensions; | |
use SessionHandlerInterface; | |
class NativeSessionHandler implements SessionHandlerInterface | |
{ | |
public function open($savePath, $sessionName) | |
{ |
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
User.get({username: req.body.username}, function(err, user) { | |
if(err) {return console.log(err);} | |
if(user) { | |
res.status(404).json({error: ["Username already exist."]}); | |
} else { | |
var user = new User({username: req.body.username, provider: 'local', email: req.body.email, password: bcrypt.hashSync(req.body.password, 10)}); | |
user.put(function(err, success){ | |
if(err) {return console.log(err)} |
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
var getConfigDirectory = function () { | |
switch (process.platform) { | |
case 'linux': return process.env.XDG_CONFIG_HOME || path.join(home(), '.config') | |
case 'darwin': return path.join(home(), 'Library', 'Preferences'); | |
case 'win32': return path.join(home(), 'AppData', 'Roaming'); | |
default: return home(); | |
} | |
} |
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 4567; | |
server_name _; | |
location / { | |
proxy_pass http://localhost:3000; | |
proxy_http_version 1.1; | |
proxy_set_header Upgrade \$http_upgrade; | |
proxy_set_header Connection 'upgrade'; | |
proxy_set_header Host \$host; | |
proxy_cache_bypass \$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
proxy_pass http://localhost:3000; | |
proxy_http_version 1.1; | |
proxy_set_header Upgrade \$http_upgrade; | |
proxy_set_header Connection 'upgrade'; | |
proxy_set_header Host \$host; |
NewerOlder