Skip to content

Instantly share code, notes, and snippets.

View AndyGaskell's full-sized avatar
🏠
Working from home

Andy Gaskell AndyGaskell

🏠
Working from home
View GitHub Profile
@vxnick
vxnick / gist:380904
Created April 27, 2010 15:52
Array of country codes (ISO 3166-1 alpha-2) and corresponding names
<?php
$countries = array
(
'AF' => 'Afghanistan',
'AX' => 'Aland Islands',
'AL' => 'Albania',
'DZ' => 'Algeria',
'AS' => 'American Samoa',
'AD' => 'Andorra',
@blitline-dev
blitline-dev / screenshot_example2.json
Last active April 14, 2016 18:46
screenshot_example_2
{
"application_id":"YOUR_APP_ID",
"src":"https://www.librato.com/",
"src_data" : { "viewport" : "1600x800" },
"src_type":"screen_shot_url",
"functions":[
{
"name":"resize_to_fit",
"params":{
"width":400
@renekreijveld
renekreijveld / joomlaupdate
Last active September 17, 2021 13:12
This bash script will update your Joomla 2.5/3.1 website to the latest Joomla version. It does this by automatically downloading the correct update zipfile from Joomla.org. The script also executes the sql update commads (if needed). If specified joomlaupdate will make a backup of your website and database before updating. Joomlaupdate can also …
#!/bin/sh
# joomlaupdate
# Updates your Joomla 2.5/3.1 website to the latest version.
#
# Usage: joomlaupdate [-s] [-b] [-h] [-l]
#
# Default action is verbose on, no backup.
# -s Silent. Do not display any informational messages.
# -b Backup. Create a backup before updating.
@tydlyn
tydlyn / .gitignore
Created September 16, 2013 11:39
Joomla .gitignore file to ignore all Joomla 3.x core files
.htaccess
administrator/cache/*
administrator/components/com_admin/*
administrator/components/com_banners/*
administrator/components/com_cache/*
administrator/components/com_categories/*
administrator/components/com_checkin/*
administrator/components/com_config/*
administrator/components/com_contact/*
administrator/components/com_content/*
@thejamescollins
thejamescollins / functions.php
Last active April 1, 2024 19:21
Display product description on WooCommerce shop/category pages
<?php
/**
* Add the product's short description (excerpt) to the WooCommerce shop/category pages. The description displays after the product's name, but before the product's price.
*
* Ref: https://gist.github.com/om4james/9883140
*
* Put this snippet into a child theme's functions.php file
*/
function woocommerce_after_shop_loop_item_title_short_description() {
global $product;

November 2016 - The Fibonacci Sequence

Task

Return the first N items of the Fibonacci sequence.

The input will be a whole number greater than or equal to zero.

The output should be iterable.

December 2016 - Oh xmas tree, oh xmas tree

Task

Return an xmas tree n rows in length.

n will always be greater than 0.

Examples:

@paceaux
paceaux / headless-screenshots.js
Last active May 13, 2024 06:34
Screenshot grabber that uses headless chrome (only works on mac)
/** Pre requisites
1) Make an Alias to Chrome
alias chrome="/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome"
alias chrome-canary="/Applications/Google\ Chrome\ Canary.app/Contents/MacOS/Google\ Chrome\ Canary"
2) Make Sure yarn is installed (it caches packages so you don't have to download them again)
`npm i yarn`
3) Use yarn to install dependencies:
`yarn add lighthouse`
@sharpred
sharpred / dart.json
Last active September 14, 2022 08:11
dart code snippet for vscode
{
// Place your snippets for dart here. Each snippet is defined under a snippet name and has a prefix, body and
// description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the
// same ids are connected.
// Example:
// "Print to console": {
// "prefix": "log",
// "body": [
// "console.log('$1');",

Using Bootstrap in Joomla 4

Joomla 4 introduces a modular approach for interactive components

  • What is a modular approach?
  • The functionality is broken down into individual components, files. There is no one file approach as it was with Bootstrap in Joomla 3. This was done for efficiency and performance gains (send only the code that is needed instead of delivering everything in case some page will need so component).

How to deal with Interactive components

  • Load what you need per case! There are helper functions that will help you achieve this and, it is dead easy just call the function with the appropriate arguments.