Skip to content

Instantly share code, notes, and snippets.

View charleslouis's full-sized avatar

okcharlo charleslouis

View GitHub Profile
@evilmarty
evilmarty / dabblet.css
Created June 29, 2012 23:12
styling the calendar indicator for webkit
html {
background: #f06;
background: linear-gradient(90deg, #cceecc,#eeeeee);
min-height: 100%;
}
input[type=date] {
background: #ccc;
background: linear-gradient(90deg, #ddd, #ccc);
border: 3px solid #eee;
border-radius: 20px;
@charleslouis
charleslouis / custom-search-acf-wordpress.php
Last active December 15, 2023 09:11
PHP - Wordpress - Search - wordpress custom search function that encompasses ACF/advanced custom fields and taxonomies and split expression before request
<?php
/**
* [list_searcheable_acf list all the custom fields we want to include in our search query]
* @return [array] [list of custom fields]
*/
function list_searcheable_acf(){
$list_searcheable_acf = array("title", "sub_title", "excerpt_short", "excerpt_long", "xyz", "myACF");
return $list_searcheable_acf;
}
const puppeteer = require('puppeteer');
class Webpage {
static async generatePDF(url) {
const browser = await puppeteer.launch({ headless: true }); // Puppeteer can only generate pdf in headless mode.
const page = await browser.newPage();
await page.goto(url, { waitUntil: 'networkidle', networkIdleTimeout: 5000 }); // Adjust network idle as required.
const pdfConfig = {
path: 'url.pdf', // Saves pdf to disk.
format: 'A4',
@KonradIT
KonradIT / readme.md
Last active September 25, 2023 01:55
GoPro Studio for Linux
@imath
imath / imath-pm-friends-only.php
Last active May 3, 2023 06:24
I was writing my second BuddyPress tutorial for wpformation.com when i realized it could be helpful for a community admin to restrict private messages to friends only...
<?php
/*** beginning of the code to paste in your functions.php ***/
function imath_pm_button_only_if_friends( $button ) {
if( is_super_admin() )
return $button;
if( 'is_friend' != friends_check_friendship_status( bp_displayed_user_id(), bp_loggedin_user_id() ) )
return false;
@aarongustafson
aarongustafson / responsive-iframes.css
Created October 25, 2011 17:07
Responsive iFrames with jQuery
iframe {
max-width: 100%;
}
@zishe
zishe / angular-pushstate-support.md
Last active May 30, 2020 05:06
Using grunt and Angular with pushstate support!
title author layout categories
Using grunt and angular with pushstate support
Blackjid
post
grunt
angularjs
yeoman
@schalkburger
schalkburger / sage_favicons.php
Last active January 16, 2020 01:33
Roots Sage Favicons
/**
* Load favicons
* Place icons in the theme images directory. Want more? http://realfavicongenerator.net/
*/
function sage_favicons() {
echo '<link rel="apple-touch-icon" sizes="57x57" href="'. get_template_directory_uri() .'/dist/images/apple-touch-icon-57x57.png">';echo "\n";
echo '<link rel="apple-touch-icon" sizes="60x60" href="'. get_template_directory_uri() .'/dist/images/apple-touch-icon-60x60.png">';echo "\n";
echo '<link rel="apple-touch-icon" sizes="72x72" href="'. get_template_directory_uri() .'/dist/images/apple-touch-icon-72x72.png">';echo "\n";
echo '<link rel="apple-touch-icon" sizes="76x76" href="'. get_template_directory_uri() .'/dist/images/apple-touch-icon-76x76.png">';echo "\n";
echo '<link rel="apple-touch-icon" sizes="114x114" href="'. get_template_directory_uri() .'/dist/images/apple-touch-icon-114x114.png">';echo "\n";
@pricejn2
pricejn2 / gandi_simple_hosting_drush.sh
Created June 18, 2014 16:37
Gandi Simple Hosting Drush install
cd tmp
wget https://github.com/drush-ops/drush/archive/6.3.0.zip
unzip 6.3.0.zip
rm -rf 6.3.0.zip
mv drush-6.3.0 ~/var/php/admin/
cd ~/var/php/admin/
mv drush-6.3.0 drush
chmod 755 drush/drush
chmod 755 drush/drush.php
nano ~/etc/bash/bashrc
@ulhas
ulhas / docker-compose.yml
Created April 9, 2017 20:32
Docker compose file for SailsJS app
version: '2'
volumes:
postgres_data_dev: {}
postgres_backup_dev: {}
services:
postgres:
build: ./compose/postgres
volumes: