Skip to content

Instantly share code, notes, and snippets.

@loilo
loilo / pass-slots.md
Last active March 27, 2024 20:58
Vue: Pass Slots through from Parent to Child Components

Vue: Pass Slots through from Parent to Child Components

The Situation

  • We've got some components A, B and C which provide different slots.
    const A = {
      template: `<div><slot name="a">Default A Content</slot></div>`
    }

const B = {

@grosscorporation
grosscorporation / Country Currency Codes JSON
Last active May 9, 2022 10:02
currency symol, name, plural, and decimal digits for all major and minor currencies
[
{
"USD" : {
"symbol" : "$",
"name" : "US Dollar",
"symbol_native" : "$",
"decimal_digits" : 2,
"rounding" : 0,
"code" : "USD",
"name_plural" : "US dollars"
@hectorguo
hectorguo / getLocalIP.js
Last active March 18, 2024 06:21
Get local IP address through Javascript
/**
* Get Local IP Address
*
* @returns Promise Object
*
* getLocalIP().then((ipAddr) => {
* console.log(ipAddr); // 192.168.0.122
* });
*/
function getLocalIP() {
@bagf
bagf / vagrant_precise32_install_php5.5.9.sh
Last active August 29, 2015 13:57
Downloads PHP 5.5.9 and builds it from source, then processed to use PECL to install memcache, libxl, openssl and gearman extensions
#!/bin/sh
echo "Installing php5 build dependencies..."
apt-get build-dep -q=2 php5
cd /tmp
# Get PHP
echo "Downloading and extracting php5.5.9 source..."
wget -q -O php5.5.9.tar.xz http://us2.php.net/get/php-5.5.9.tar.xz/from/this/mirror
tar xf php5.5.9.tar.xz
cd php-5.5.9/
@dypsilon
dypsilon / frontendDevlopmentBookmarks.md
Last active March 27, 2024 06:36
A badass list of frontend development resources I collected over time.
@mrclay
mrclay / firstLast.sql
Created April 3, 2012 14:02
MySQL: Extract last and first name(s) from a full "name" field (for Elgg)
SELECT
-- Assumed to be trimmed
name
-- Does name contain multiple words?
,(LOCATE(' ', name) = 0) AS hasMultipleWords
-- Returns the end of the string back until reaches a space.
-- E.g. "John Doe" => "Doe"
-- E.g. "Francis Scott Key" => "Key"