Skip to content

Instantly share code, notes, and snippets.

View robbyahn's full-sized avatar

Robby robbyahn

  • MSD
  • Wellington
View GitHub Profile
@robbyahn
robbyahn / RestoreFileVersionTask.php
Last active August 9, 2024 02:55
Silverstripe 5 restore file assets to previous version
/*
* dev/tasks/RestoreFileVersionTask?FileID=1&Version=13
* https://docs.silverstripe.org/en/4/developer_guides/files/file_management/#configuring-file-archiving
* In order to do keep all files, should set up keep_archived_assets in config/assets.yml
* SilverStripe\Assets\File:
* keep_archived_assets: true
*/
<?php
@robbyahn
robbyahn / singleselect-native-select-tag.js
Last active July 10, 2024 05:00
Single select and Multi select list box
/*
Passing Data Between React Components
https://codepen.io/smhigley/pen/GRgjRVN
https://medium.com/@ruthmpardee/passing-data-between-react-components-103ad82ebd17
*/
import React, { useState, useEffect, useRef } from 'react';
import Component from '../core/component.js';
const SearchSortby = () => {
/*
Passing Data Between React Components
https://codepen.io/smhigley/pen/GRgjRVN
https://medium.com/@ruthmpardee/passing-data-between-react-components-103ad82ebd17
*/
import React, { useState, useEffect, useRef } from 'react';
import Component from '../core/component.js';
const SearchSortby = () => {
@robbyahn
robbyahn / deploy.sh
Created October 26, 2023 17:35 — forked from W0lfw00d/deploy.sh
Drupal 8 deploy script (requires Drush)
#!/bin/bash
# Run as: ./deploy.sh /dir/name
# TODO:
# - add a starting directory
# - add a backup script to run before updating, you know just in case...
# - add error checking
# - add a safety token/password to prevent unauthorized calls
# - Employ git hook
@robbyahn
robbyahn / gist:a0ed4231412510a7cbd54789332e22ea
Created March 31, 2023 22:21
React + GatsbyJS build errors fix
/*
Issue 1
Gatsby react TypeError: leaflet_src.Icon is not a constructor
from
const markerIcon = new Icon({
iconUrl: markerIconPng
});
Issue 2
@robbyahn
robbyahn / .block
Created March 31, 2020 23:27 — forked from jrzief/.block
bar chart races
license: mit
@robbyahn
robbyahn / install casperjs (and phantomjs) on ubuntu
Created August 5, 2019 00:14 — forked from andrewslince/install casperjs (and phantomjs) on ubuntu
simple tutorial for installing casperjs on ubuntu
# install phantomjs
cd /usr/local/share
sudo wget https://phantomjs.googlecode.com/files/phantomjs-1.9.2-linux-x86_64.tar.bz2
sudo tar xjf phantomjs-1.9.2-linux-x86_64.tar.bz2
sudo ln -s /usr/local/share/phantomjs-1.9.2-linux-x86_64/bin/phantomjs /usr/local/share/phantomjs; sudo ln -s /usr/local/share/phantomjs-1.9.2-linux-x86_64/bin/phantomjs /usr/local/bin/phantomjs; sudo ln -s /usr/local/share/phantomjs-1.9.2-linux-x86_64/bin/phantomjs /usr/bin/phantomjs
sudo apt-get install fontconfig
# install casperjs
cd /var/www/
git clone git://github.com/n1k0/casperjs.git
@robbyahn
robbyahn / 00.howto_install_phantomjs.md
Created August 5, 2019 00:00 — forked from julionc/00.howto_install_phantomjs.md
How to install PhantomJS on Debian/Ubuntu

How to install PhantomJS on Ubuntu

Version: 1.9.8

Platform: x86_64

First, install or update to the latest system software.

sudo apt-get update
sudo apt-get install build-essential chrpath libssl-dev libxft-dev
@robbyahn
robbyahn / ubuntu-server-setup-16.04.md
Created November 5, 2018 16:44 — forked from marcuslilja/ubuntu-server-setup-16.04.md
Server setup for Ubuntu 16.04 on Digital Ocean

Server setup for Ubuntu 16.04 on Digital Ocean

The setup installs the following software:

  • Nginx
  • MySQL
  • PHP
  • Node
  • Composer
@robbyahn
robbyahn / index.html
Created August 31, 2017 03:08 — forked from crofty/index.html
A example of using Google Map tiles with the Leaflet mapping library - http://matchingnotes.com/using-google-map-tiles-with-leaflet
<!DOCTYPE html>
<html>
<head>
<title>Leaflet</title>
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.3.1/leaflet.css" />
<script src="http://cdn.leafletjs.com/leaflet-0.3.1/leaflet.js"></script>
<script src="http://maps.google.com/maps/api/js?v=3.2&sensor=false"></script>
<script src="http://matchingnotes.com/javascripts/leaflet-google.js"></script>
</head>
<body>