$name = @$_POST['name'];
# => null or the value for name
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
import cv2 | |
from flask import Flask, Response | |
from ultralytics import YOLO | |
app = Flask(__name__) | |
model2 = YOLO("models/yolov8n-face.pt") | |
cam = cv2.VideoCapture(0) | |
if not cam.isOpened(): |
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
" pathogen | |
execute pathogen#infect() | |
syntax on | |
filetype plugin indent on | |
" colors | |
set t_Co=256 | |
colorscheme desert256v2 |
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 detach(fn, cls) { | |
if (typeof cls.prototype[fn] !== 'function') { | |
throw new Error(fn + ' is not an instance function'); | |
} | |
return cls.prototype[fn].call.bind(cls.prototype[fn]); | |
} | |
var slice = detach('slice', Array); | |
var map = detach('map', Array); |
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
<?xml version="1.0"?> | |
<root> | |
<!-- mac management --> | |
<item> | |
<name>Set Command_L + Esc to Window Switch</name> | |
<identifier>private.cmd_l_esc_to_window_switch</identifier> | |
<autogen> | |
__KeyToKey__ | |
KeyCode::ESCAPE, |
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
array_walk($headers, function ($value, $key) { | |
# validate header key (ref: zend-diactoros) | |
if (! preg_match('/^[a-zA-Z0-9\'`#$%&*+.^_|~!-]+$/', $key)) { | |
throw new InvalidArgumentException("Invalid header name - {$key}"); | |
} | |
# validate header values (ref: zend-diactoros) | |
$values = is_array($value) ? $value : [$value]; | |
foreach ($values as $val) { |
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 declare(strict_types=1); | |
# Executes a select and returns a single row. | |
function mysqli_select_one($db, string $sql, ...$params) { | |
$stmt = mysqli_interpolate($db, $sql, ...$params); | |
if ( | |
!mysqli_stmt_execute($stmt) || | |
false === ($result = mysqli_stmt_get_result($stmt)) |
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 __DIR__.'/routes.php'; | |
use badphp\routes\{ | |
function get, | |
function post, | |
function lookup | |
}; | |
# let's create some routes |
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 | |
// bootstrap file | |
use aphpy as app; | |
$blogs = app\load(__DIR__.'/fruits.php'); | |
$books = app\load(__DIR__.'/books.php'); | |
$v1 = app\prefix('v1', [ | |
'books' => $books, |
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
# behaviour | |
set -g base-index 1 | |
set -g pane-base-index 1 | |
set -g visual-activity on | |
set -g default-terminal "screen-256color" | |
setw -g monitor-activity on | |
# ctrl-a instead of ctrl-b | |
# set-option -g prefix C-a |
NewerOlder