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
const express = require("express"); | |
const querystring = require("querystring"); | |
const session = require("express-session"); | |
const app = express(); | |
const port = 8080; | |
const url = `http://localhost:${port}`; | |
const oauthServer = "https://app.startinfinity.com"; | |
const appId = "<paste-app-id>"; |
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 | |
# Start at :30 seconds | |
WAIT_FOR_MIDDLE_OF_MINUTE=$(( ( 90 - $(date +%S) ) % 60 )) | |
sleep $WAIT_FOR_MIDDLE_OF_MINUTE | |
START=$(date +%s%N) | |
INTERVAL_SECONDS=60 | |
INTERVAL_NANOSECONDS=$(( $INTERVAL_SECONDS * 1000000000 )) | |
i=1 |
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
try { throw Error() } catch (e) { | |
var stack = e.stack.split('\n').map(l => l.match(/\((.*).+\)/)).filter(Boolean) | |
.map(l => l[1]) | |
.filter(l => !l.includes('node_modules') && l.includes('/app/')) | |
.slice(1, 4) | |
console.count('findByUserAndNetworkId: ' + stack.join(' -> ')) | |
}; |
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\Chart; | |
use app\Chart\Http\SomeMiddleware; | |
use Illuminate\Routing\Router; | |
use Illuminate\Support\ServiceProvider; | |
class ChartServiceProvider extends ServiceProvider | |
{ |
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
<script id="sweetMessages" type="application/json">{!! json_encode(array_only(session()->all(), ['success', 'error', 'warning'])) !!}</script> | |
<script> | |
var sweetMessages = JSON.parse($('#sweetMessages').html()); | |
setTimeout(function () { | |
Object.keys(sweetMessages).forEach(function (key) { | |
return swal(sweetMessages[key], '', key); | |
}); | |
}, 0); | |
</script> |
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 | |
// Repeating characters possible | |
echo substr(str_shuffle(str_repeat('0123456789abcdefghijklmnopqrstvwxyz', 5)), 0, 5); | |
// No repeating characters | |
echo substr(str_shuffle('0123456789abcdefghijklmnopqrstvwxyz'), 0, 5); |
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
# Redirecting | |
# From www to without www | |
RewriteCond %{HTTP_HOST} ^www\.domain.rs$ | |
RewriteRule (.*) http://domain.rs/$1 [R=301,L] | |
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
#!/usr/local/bin/php -q | |
<?php | |
error_reporting(E_ALL); | |
session_start(); | |
/* Allow the script to hang around waiting for connections. */ | |
set_time_limit(0); | |
/* Turn on implicit output flushing so we see what we're getting |
NewerOlder