Skip to content

Instantly share code, notes, and snippets.

View dave1010's full-sized avatar

Dave Hulbert dave1010

View GitHub Profile
@dave1010
dave1010 / get-localities-from-osm.php
Created January 8, 2024 12:53
Get localities from OSM
<?php
// API details: https://wiki.openstreetmap.org/wiki/Overpass_API
// Define your bounding box [south latitude, west longitude, north latitude, east longitude]
$bbox = array(51.28, -0.489, 55.81, 1.76); // Example bounding box around London
// Construct the Overpass query
$query = "[out:json];(node[\"place\"=\"city\"](".implode(',', $bbox).");node[\"place\"=\"town\"](".implode(',', $bbox)."););out;";
@dave1010
dave1010 / Tasker-launch-chatGPT-voice.xml
Created November 30, 2023 22:33
Tasker-launch-chatGPT-voice.xml
<TaskerData sr="" dvi="1" tv="6.1.32">
<Task sr="task4">
<cdate>1701381152290</cdate>
<edate>1701383416926</edate>
<id>4</id>
<nme>ChatGPT Voice</nme>
<pri>100</pri>
<Action sr="act0" ve="7">
<code>25</code>
<Int sr="arg0" val="0"/>
@dave1010
dave1010 / gptv
Created November 22, 2023 16:59
GPT-Vision Command line script
#!/bin/bash
# Check if the correct number of arguments is provided
if [ "$#" -ne 2 ]; then
echo "Usage: $0 '<prompt>' '<image_url>'"
exit 1
fi
PROMPT=$1
IMAGE_URL=$2
from scapy.all import *
def arp_display(pkt):
if pkt[ARP].op == 1: #who-has (request)
if pkt[ARP].psrc == '0.0.0.0': # ARP Probe
print "ARP Probe from: " + pkt[ARP].hwsrc
print sniff(prn=arp_display, filter="arp", store=0, count=10)
@dave1010
dave1010 / cachebuster.php
Created March 23, 2016 14:57
Cache buster
interface CacheBuster
{
/**
* @return string version
* @throws \NoVersionException
*/
public function getVersion();
}
class MultipleCacheBuster
module.exports = leftpad;
function leftpad (str, len, ch) {
str = String(str);
var i = -1;
if (!ch && ch !== 0) ch = ' ';
len = len - str.length;
@dave1010
dave1010 / README.md
Last active February 7, 2016 10:12
Downloading YouTube videos

Downloading YouTube videos

  1. Open chosen video in browser
  2. Click Download YouTube Video (just below the address bar)
  3. Wait for page to load.
  4. Click on Start!
  5. Wait for page to load.
  6. Click on Download
  7. Close any pop up adverts
  8. It should have a yellow bar asking to open or save; if not then click the"Download" button again.
@dave1010
dave1010 / CallRoute.php
Created December 7, 2015 09:31
Call a route in Laravel. Doens't quite work properly IIRC
<?php
use Illuminate\Console\Command;
use Illuminate\Routing\Router;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Input\InputArgument;
class CallRoute extends Command {
protected $name = 'route:call';
#!/bin/bash
# stolen from template file
if git rev-parse --verify HEAD > /dev/null
then
against=HEAD
else
# Initial commit: diff against an empty tree object
against=4b825dc642cb6eb9a060e54bf8d69288fbee4904
@dave1010
dave1010 / css_resources.md
Last active August 29, 2015 14:18 — forked from jookyboi/css_resources.md
CSS libraries and guides to bring some order to the chaos.

Libraries

  • 960 Grid System - An effort to streamline web development workflow by providing commonly used dimensions, based on a width of 960 pixels. There are two variants: 12 and 16 columns, which can be used separately or in tandem.
  • Compass - Open source CSS Authoring Framework.
  • Bootstrap - Sleek, intuitive, and powerful mobile first front-end framework for faster and easier web development.
  • Font Awesome - The iconic font designed for Bootstrap.
  • Zurb Foundation - Framework for writing responsive web sites.
  • SASS - CSS extension language which allows variables, mixins and rules nesting.
  • Skeleton - Boilerplate for responsive, mobile-friendly development.

Guides