Skip to content

Instantly share code, notes, and snippets.

@dakala
dakala / tom-select.blade.php
Created February 2, 2022 11:02 — forked from mithicher/tom-select.blade.php
Tom Select Livewire Blade Component
/* Component Usage
// Data for options
$users = \App\User::limit(6)->get()->transform(fn($user) => [
'id' => $user->id,
'title' => $user->name,
'subtitle' => $user->email
]);
// Usage in view
@dakala
dakala / Portable-utf8
Created October 6, 2021 14:43 — forked from Dethnull/Portable-utf8
This is a fork of the Portable-utf8 library found here, http://pageconfig.com/post/portable-utf8. I've fixed some typos and also added a function called utf8_whitespace_table which returns an array of whitespaces as defined here, http://www.bogofilter.org/pipermail/bogofilter/2003-March/001889.html
<?php
/**
* Portable UTF-8
* Lightweight Library for Unicode Handling in PHP
* @details http://pageconfig.com/post/portable-utf8
* @demo http://pageconfig.com/post/portable-utf-8-demo
*
* @version 1.3
@dakala
dakala / google_calendars.yml
Created October 31, 2019 11:29 — forked from silentshade/google_calendars.yml
Google holidays calendar ids with alpha2 YAML
en:
religious:
- :name: Christian
:id: en.christian#[email protected]
- :name: Islamic
:id: en.islamic#[email protected]
- :name: Jewish
:id: en.jewish#[email protected]
national:
- :name: Australian
#!/bin/bash
curl -OL https://github.com/drush-ops/drush-launcher/releases/download/0.6.0/drush.phar
chmod +x drush.phar
sudo mv drush.phar /usr/local/bin/drush
@dakala
dakala / vocab_delete.php
Created July 4, 2018 14:06
Delete all terms in a vocabulary (Drupal 8)
<?php
$tids = \Drupal::entityQuery('taxonomy_term')
->condition('vid', 'VOCABULARY_ID')
->execute();
$controller = \Drupal::entityTypeManager()->getStorage('taxonomy_term');
$entities = $controller->loadMultiple($tids);
$controller->delete($entities);
@dakala
dakala / killmongo.sh
Created April 15, 2018 21:13
Clean uninstall of mongo db
#!/usr/bin/env sh
# checks to see if running
launchctl list | grep mongo
launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.mongodb.plist
launchctl remove homebrew.mxcl.mongodb
pkill -f mongod
@dakala
dakala / renamedb.sh
Last active April 15, 2018 21:15
Rename a MySQL database
#!/bin/bash
# Disclaimer - make backups, use at your own risk.
#
# Based on this comment: http://stackoverflow.com/a/13944924/843067
# Views and stored procedures have to be done separately.
OLDDB="thunder"
NEWDB="phpedu"
MYSQL="mysql -u root -p "
[{
"ISO_3166alpha2": "AD",
"ISO_3166alpha3": "AND",
"ISO_3166numeric": "020",
"fips": "AN",
"Country": "Andorra",
"Capital": "Andorra la Vella",
"Area": "468.0",
"Population": "84,000",
"Continent": "EU",
@dakala
dakala / demo_map.js
Last active November 18, 2017 03:53
import React from 'react';
import { compose, withProps, withHandlers } from "recompose";
import { withScriptjs, withGoogleMap, GoogleMap, Marker } from "react-google-maps";
import { MarkerClusterer } from "react-google-maps/lib/components/addons/MarkerClusterer";
import axios from 'axios';
const MapWithAMarkerClusterer = compose(
withProps({
googleMapURL: "https://maps.googleapis.com/maps/api/js?key=AIzaSyC4R6AN7SmujjPUIGKdyao2Kqitzr1kiRg&v=3.exp&libraries=geometry,drawing,places",
loadingElement: <div style={{ height: `100%` }} />,
diff --git a/.platform/local/project.yaml b/.platform/local/project.yaml
index d76c7c6..6736607 100644
--- a/.platform/local/project.yaml
+++ b/.platform/local/project.yaml
@@ -1,2 +1,3 @@
id: 4a3nbi2oz2kuo
host: bc.platform.sh
+alias-group: ro
diff --git a/.platform/routes.yaml b/.platform/routes.yaml
index 684bda4..c6746a6 100644