Skip to content

Instantly share code, notes, and snippets.

View Themodem's full-sized avatar

Lee Themodem

  • FrogEducation
  • United Kingdom
View GitHub Profile
@Raistlfiren
Raistlfiren / Dockerfile
Last active September 28, 2025 20:49
XDebug 3 and Docker Reference
FROM php:7.4-cli-alpine
# Install xdebug
RUN apk add --no-cache --virtual .phpize-deps $PHPIZE_DEPS \
&& pecl install xdebug \
&& docker-php-ext-enable xdebug \
&& apk del .phpize-deps
WORKDIR /var/www/html
@divinity76
divinity76 / duckduckgo.imagesearch.php
Created April 29, 2020 20:37
duckduckgo image search libcurl php
<?php
declare(strict_types=1);
$search_query="Nintendo 64 controller";
require_once('hhb_.inc.php');
$hc=new hhb_curl('',true);
$hc->setopt_array(array(
CURLOPT_CONNECTTIMEOUT=>10,
CURLOPT_TIMEOUT=>20,
// without a fake useragent, you will get the error: <div id="error_homepage" style="display:block">Oops, there was an error. &nbsp;Please try again.<br><br>If it persists, please email error@duckduckgo.com<br><img src="https://improving.duckduckgo.com/t/fpbot">
@Haraldson
Haraldson / usage.js
Last active March 11, 2023 13:53
Lodash useDebounce React Hook
import React, { useState, useEffect } from 'react'
import { useDebounce } from './use-debounce'
const MySearchComponent = props => {
const [search, setSearch, {
signal,
debouncing
}] = useDebounce('')
const [results, setResults] = useState([])
@xuwang
xuwang / vault-secrets-the-simple-way.md
Created February 22, 2020 20:37
Vault Secrets The Simple Way

Vault Secrets the Simple Way

This article introduces a simple way of working with Hashicorp Vault key-value secrets engine.

Prerequisites

You should have a running Hashicorp/Vault service and Vault command available.

Here is a quick way to install a Vault dev server.

@noelbundick
noelbundick / LICENSE
Last active September 23, 2025 10:49
Exclude WSL installations from Windows Defender realtime protection
MIT License
Copyright (c) 2018 Noel Bundick
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@goodwill
goodwill / cloud-sql-proxy.service
Last active September 27, 2024 11:20
Example Systemd file for starting cloud sql proxy at system start
[Install]
WantedBy=multi-user.target
[Unit]
Description=Google Cloud Compute Engine SQL Proxy
Requires=networking.service
After=networking.service
[Service]
Type=simple
@wgrafael
wgrafael / functions.php
Last active July 6, 2023 18:04
Convert array with key in dot notation for multidimensional array
<?php
/**
* Convert array with key in dot notation for multidimensional array
*
* Example:
* Input: [ "name.firstname" => "Rafael", "name.lastname" => "Dantas", "a.b.c" => "d" ]
* Output: [ "name" => [ "firstname" => "Rafael", "lastname" => "Dantas" ], "a" => [ "b" => [ "c" => "d" ] ]
*
* @param $array Array with key in dot notation
@risyasin
risyasin / centos-php7-install.sh
Last active July 2, 2017 07:43
PHP7 on Fedora 23 with php-fpm
## Create a source directory
## mkdir /usr/src/php7
## cd /usr/src/php7
## copy this files as /usr/src/php7/install.sh
## aria2c https://gist.githubusercontent.com/risyasin/92075324caa9a46bfd5c/raw/83e0851c42afc4f3557bc4aea02197ddf92fed73/centos-php7-install.sh
## php7 compile requirements
dnf install -y git
dnf install -y gcc bison automake autoconf
@u0d7i
u0d7i / disable_vim_auto_visual_on_mouse.txt
Last active October 19, 2025 17:42
Disable vim automatic visual mode on mouse select
Disable vim automatic visual mode on mouse select
issue: :set mouse-=a
add to ~/.vimrc: set mouse-=a
my ~/.vimrc for preserving global defaults and only changing one option:
source $VIMRUNTIME/defaults.vim
set mouse-=a
@darrenpmeyer
darrenpmeyer / openconnect-7-ubuntu-build.md
Last active June 10, 2020 16:24
Building OpenConnect 7 on Ubuntu 14 (trusty), 15 (vivid), and 16 (xenial)