Skip to content

Instantly share code, notes, and snippets.

@pawellenart
pawellenart / ytclock.js
Last active July 9, 2024 08:41
Add clock to YouTube player controls panel
javascript:if(!document.getElementById("ytx-clock")){function t(){var e=new Date,r=e.getHours(),l=e.getMinutes(),a=(r=r<10?"0"+r:r)+":"+(l=l<10?"0"+l:l);document.getElementById("ytx-clock").innerText=a,document.getElementById("ytx-clock").textContext=a,setTimeout(t,1e4)}var e=document.createElement("div"),r=document.createAttribute("id");r.value="ytx-clock",e.setAttributeNode(r);var l=document.createAttribute("class");l.value="ytp-time-display",e.setAttributeNode(l);var a=document.createAttribute("onload");a.value="sT()",e.setAttributeNode(a),document.getElementsByClassName("ytp-right-controls")[0].prepend(e),t()}
PROMPT=' %{$fg_bold[cyan]%}%c%{$reset_color%} $(git_prompt_info)'
PROMPT+="%(?:%{$fg_bold[green]%}❯%{$reset_color%} :%{$fg_bold[red]%}❯%{$reset_color%} )"
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[blue]%}git:(%{$fg[red]%}"
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%} "
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[blue]%}) %{$fg[yellow]%}✗"
ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[blue]%})"
import { getToken } from 'next-auth/jwt';
import { NextResponse } from 'next/server';
export async function middleware(req) {
// token will exist if user is logged in
const token = await getToken({
req,
secret: process.env.JWT_SECRET,
secureCookie:
process.env.NEXTAUTH_URL?.startsWith('https://') ??
#!/bin/bash
usage()
{
cat <<'USAGE'
Name
review - Gerrit review posting tool
Description
Title: Strategy Guide 1.10 for X-COM: Enemy Unknown (PSX)
Description: Strategic and tactical tips and lists.
Revision Log:
1.10 I added cheat codes and revised the table of alien squad & equipment.
1.02 I did some corrections and additions.
1.01 Minor update.
1.00 The Guide was created and posted in this form in December of 2005.
<?php
class HookSentry_HookHandler {
public function __construct() {}
/**
* Kontroler: index
* Akcja: index
* Trigger: default
*
var fsButton = document.getElementById('fsbutton'),
container = document.getElementById('canvas');
if (window.fullScreenApi.supportsFullScreen) {
fsButton.style.display = 'block';
fsButton.addEventListener('click', function() {
if (fsButton.className == 'fs-off') {
window.fullScreenApi.requestFullScreen(container);
<?php
require_once SITE_PATH . 'inc/lib/DatabaseDriver.class.php';
abstract class BaseModel extends DatabaseDriver implements ArrayAccess, Iterator {
protected $tablename = null;
private $schema;
protected $attributes = array();
private $is_new = true;
<?php
require_once SITE_PATH . 'inc/lib/DatabaseDriver.class.php';
abstract class BaseModel extends DatabaseDriver implements ArrayAccess {
protected $tablename = null;
private $schema;
private $attributes = array();
private $is_new = true;
<?php
/**
* Eurotax Valuation Webservice Handler
*
* This class allows connecting to Eurotax Webservice, fetching dictionary data
* and request vehicle valuation.
*
* Usage example:
* <code>
* <?php