Skip to content

Instantly share code, notes, and snippets.

View AndrewSepic's full-sized avatar

Andrew AndrewSepic

  • Mapbox
  • Earth, for now
View GitHub Profile
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@AndrewSepic
AndrewSepic / parseGeoJSON.js
Created August 26, 2025 20:09
Parse & read GeoJSON features with fs
import fs from 'fs';
const filePath = './public-schools.geojson';
const data = JSON.parse(fs.readFileSync(filePath, 'utf8'));
if (data.type === 'FeatureCollection' && Array.isArray(data.features)) {
console.log(`Found ${data.features.length} features`);
data.features.forEach((feature, index) => {
@AndrewSepic
AndrewSepic / index.html
Last active August 15, 2025 20:12
Basic HTML Template - BUILD 2025
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Your First Map: BUILD with Mapbox 2025</title>
<meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no">
</head>
<body>
<script>
curl 'https://api.mapbox.com/search/searchbox/v1/suggest?q=Stuttgart&session_token=0daf4062-cd1f-44f1-8963-aa923ee06696&language=de&proximity=-73.990593%2C40.740121&access_token=YOUR_MAPBOX_ACCESS_TOKEN' | jq '.'
{
"suggestions": [
{
"name": "Stuttgart",
"mapbox_id": "dXJuOm1ieHBsYzpCSlFvT2c",
"feature_type": "place",
"place_formatted": "Baden-Württemberg, Deutschland",
"context": {
@AndrewSepic
AndrewSepic / splitNames.php
Created August 24, 2022 19:06
Take in First Name Last name and return Last Name, First Name Initial
function orderby_lastname ($legislator_name) {
$explodedName = explode(' ', $legislator_name);
if (count($explodedName) == 2) {
$lastNameFirst = array_reverse($explodedName);
$lastNameFirst = implode(' ', $lastNameFirst);
} else {
$lastName = array_pop($explodedName);
array_unshift($explodedName, $lastName);
$lastNameFirst = implode(' ', $explodedName);
}
@AndrewSepic
AndrewSepic / getOrderResult.php
Created November 9, 2021 19:14
Manually created XML for soapVar()
<?php
namespace SoapSapBridge\Server\Action\GetOrder\Nodes;
/**
* Class GetOrdersResult
* @package SoapSapBridge\Server\Model\GetOrdersModel
*/
class GetOrdersResult {
/**
@AndrewSepic
AndrewSepic / linux-commands.trm
Last active October 18, 2021 19:59
My Favourite Linux/Terminal Commands
// Disk Usage
// -h Human readable -dX depth of returned folders /filepath where the du command initiates
du -h -d2 /sites/onsmd
// Remove Directory with Files
rm -rf filname
@AndrewSepic
AndrewSepic / My Favourite GIT commands
Last active August 24, 2024 00:07
A list of my most used git commands for reference
// Create a new branch from the current branch which has uncommitted work
git checkout -b <branch_name>
// Fetch all latest versions of remote & branches
git fetch -all
// Delete a local branch (forces delete with -D rather than -d )
$ git branch -D <local-branch>
// See what files were changed in a commit
@AndrewSepic
AndrewSepic / search.php
Created January 8, 2021 21:07
Search Results template for Prana Framework
<?php
/**
* The template for displaying search results pages
*
* @link https://developer.wordpress.org/themes/basics/template-hierarchy/#search-result
*
* @package Prana
*/
get_header(); ?>
<?php
/**
* Template part for displaying the instagram Feed. Dependent upon Smashballoon's instagram feed pro
*
* @link https://www.advancedcustomfields.com/resources/flexible-content/
*
* @package Prana
*/
// settings