Skip to content

Instantly share code, notes, and snippets.

<?php
$json = <<<JSON
{
"kind": "youtube#searchListResponse",
"etag": "\"I_8xdZu766_FSaexEaDXTIfEWc0/hys1HflQr8XiiYpydVnkJA-oudA\"",
"regionCode": "DE",
"pageInfo": {
"totalResults": 1,
"resultsPerPage": 5
},
@0xMatt
0xMatt / Drisate.php
Created October 27, 2016 14:34
crappily filter by timestamp in last hour
<?php
foreach (new DirectoryIterator('./') as $fileInfo) {
if($fileInfo->isDot()) continue;
$file = $fileInfo->getBasename();
//var_dump($file);
@0xMatt
0xMatt / my.initializer.ts
Last active March 26, 2017 19:15
OBJECTS is empty when compiled but when via ng serve
import {OBJECTS} from './my.token.ts';
@Injectable()
export class MyInitializer {
constructor(private injector: Injector) {
}
appInitializer(): Promise<any> {
const p: Promise<any> = this.injector.get(LOCATION_INITIALIZED, Promise.resolve(null));
return p.then(() => {
@0xMatt
0xMatt / .compton.conf
Last active October 11, 2018 05:41
Dots
# Basic compton config with fade transition and shadows
# Full list of options at: https://github.com/chjj/compton/blob/master/man/compton.1.asciidoc
# Performance tweak options, more info at https://github.com/chjj/compton/wiki
paint-on-overlay = true; # Paint on X Composite overlay window instead of on root window
glx-no-stencil = true;
glx-no-rebind-pixmap = true;
# Drop shadows
@0xMatt
0xMatt / sed-collation-issue-fixes
Created March 30, 2022 20:57 — forked from amurrell/sed-collation-issue-fixes
Fix collation and character set error from old mysql
# Unknown collation: 'utf8mb4_unicode_520_ci'
sed -i'.bak' "s/utf8mb4_unicode_520_ci/utf8mb4_unicode_ci/g;" file.sql
# COLLATION 'utf8_general_ci' is not valid for CHARACTER SET 'utf8mb4'
sed -i'.bak' "s/utf8_general_ci/utf8mb4_unicode_ci/g;" file.sql
@0xMatt
0xMatt / Contact.tsx
Created July 1, 2025 16:50
Component rendering twice
'use client';
import { Button } from '@/components/ui/button';
import { Input } from '@/components/ui/input';
import { Send } from 'lucide-react';
import { useActionState } from 'react';
import { Label } from '@/components/ui/label';
import { Textarea } from '@/components/ui/textarea';
import Form from 'next/form';
import { contact } from '@/app/contact/actions';