Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Denys Nosov DenysNosov

🏠
Working from home
View GitHub Profile
@Septdir
Septdir / README-ru-RU.md
Last active Dec 22, 2021
Joomla Install Script
View README-ru-RU.md

Установочный скрипт для Joomla

Пример установочного скрипта для Joomla

@jsanta
jsanta / index.html
Last active Oct 19, 2021
PWA index.html file for Android and iOS copy & paste enabled
View index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Ionic App</title>
<base href="/" />
<meta
name="viewport"
@mhoffmann
mhoffmann / loadGeoIp.sh
Created Jun 28, 2016
script to load GeoLite2 Database into MySQL
View loadGeoIp.sh
#!/usr/bin/env bash
#apt-get install -y unzip
wget http://geolite.maxmind.com/download/geoip/database/GeoLite2-City-CSV.zip
unzip GeoLite2-City-CSV.zip
cd GeoLite2-City-CSV_*
mv GeoLite2-City-Blocks-IPv4.csv /tmp/GeoLite2-City-Blocks-IPv4.csv
mv GeoLite2-City-Locations-en.csv /tmp/GeoLite2-City-Locations-en.csv
mysqladmin create geoip
@codescribblr
codescribblr / video-functions.php
Created Feb 17, 2014
functions related to video embeds in wordpress
View video-functions.php
<?php
# This file contains functions that are related with videos
#
# Filters/resizes video embed codes.
#
function filter_video($html, $wmode = false, $width = false, $height = false) {
$final_html = $html;
if ($wmode) {
if (strpos($final_html, 'iframe') !== FALSE && strpos($final_html, 'youtube') !== FALSE) {
@paulferrett
paulferrett / imagick_average_colour.php
Created Dec 23, 2013
This function will get the average colour of an image file using PHP and Image Magick using the IMagick extension.
View imagick_average_colour.php
<?php
/**
* Get the average pixel colour from the given file using Image Magick
*
* @param string $filename
* @param bool $as_hex Set to true, the function will return the 6 character HEX value of the colour.
* If false, an array will be returned with r, g, b components.
*/
function get_average_colour($filename, $as_hex_string = true) {
View SplClassLoader.php
<?php
/*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,