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 | |
require 'vendor/autoload.php'; | |
$app = new \Slim\Slim(); | |
$app->add(new \Slim\Middleware\SessionCookie(array('secret' => 'myappsecret'))); | |
$authenticate = function ($app) { | |
return function () use ($app) { | |
if (!isset($_SESSION['user'])) { |
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
-- show running queries (pre 9.2) | |
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query | |
FROM pg_stat_activity | |
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%' | |
ORDER BY query_start desc; | |
-- show running queries (9.2) | |
SELECT pid, age(clock_timestamp(), query_start), usename, query | |
FROM pg_stat_activity | |
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%' |
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\Notifications; | |
use Illuminate\Bus\Queueable; | |
use Illuminate\Notifications\Notification; | |
use Illuminate\Contracts\Queue\ShouldQueue; | |
use Illuminate\Notifications\Messages\MailMessage; | |
//This example use the official's sendgrid php helper (https://github.com/sendgrid/sendgrid-php) |
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
// Comments | |
++ -- /= && || ||= | |
-> => :: __ | |
== === != =/= | |
<= >= <==> | |
/* */ // /// | |
\n \\ | |
<< <<< <<= >> >>> >>= |= ^= | |
0xFF 1920x1080 |
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
version: '3' | |
services: | |
proxy: | |
container_name: proxy | |
image: jwilder/nginx-proxy | |
ports: | |
- 80:80 | |
volumes: |
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: @musaid | |
// https://twitter.com/musaid/status/1039688749205020672 | |
// Ligatures built into Operator Mono as "Operator Mono Lig" with https://github.com/kiliman/operator-mono-lig | |
// VS Code Extensions: | |
// Material Icon Theme (Philip Kief), | |
// indent-rainbow (oderwat), | |
// Rainbow Brackets (2gua), | |
// Subtle Match Brackets (Rafa Mel), | |
// Git Lense | |
// Prettier (Esben Petersen) (require config file with requireConfig) |
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 { | |
client_body_in_file_only clean; | |
client_body_buffer_size 32K; | |
client_max_body_size 300M; | |
sendfile on; | |
send_timeout 300s; | |
# Port that the web server will listen on. | |
#listen 80; |
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
$(function() { | |
$('#sortable').sortable({ | |
start: function(event, ui) { | |
var start_pos = ui.item.index(); | |
ui.item.data('start_pos', start_pos); | |
}, | |
change: function(event, ui) { | |
var start_pos = ui.item.data('start_pos'); | |
var index = ui.placeholder.index(); | |
if (start_pos < index) { |
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
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing! | |
VAGRANTFILE_API_VERSION = "2" | |
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| | |
config.ssh.username = "vagrant" | |
config.ssh.password = "vagrant" | |
config.vm.box = "trusty64" |
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
CREATE DEFINER=`admin`@`10.0.0.1` PROCEDURE `removeProcessed`(table_name VARCHAR(255), keyField VARCHAR(255), maxId INT, num_rows INT) | |
BEGIN | |
SET @table_name = table_name; | |
SET @keyField = keyField; | |
SET @maxId = maxId; | |
SET @num_rows = num_rows; | |
SET @sql_text1 = concat('SELECT MIN(',@keyField,') INTO @a FROM ',@table_name); | |
PREPARE stmt1 FROM @sql_text1; | |
EXECUTE stmt1; |
NewerOlder