Skip to content

Instantly share code, notes, and snippets.

View gigo6000's full-sized avatar
💻

Carlos Mafla gigo6000

💻
View GitHub Profile
@gigo6000
gigo6000 / critical.js
Last active April 20, 2022 16:00
Critical CSS example
const critical = require("critical");
const baseUrl = "https://www.github.com";
const targetPath = "public/css/";
const dimensions = [
{
width: 320,
height: 568,
},
{
@gigo6000
gigo6000 / wp_usermeta.md
Last active April 1, 2020 22:17 — forked from magnific0/wp_usermeta.md
Show and Edit User Meta in Wordpress

#Show and Edit User Meta in Wordpress

Description

This simple procedure will allow you to:

  1. Display user meta fields under in the user list as additional columsn (Users > All Users).
  2. Display these fields on user profiles.
  3. Edit these fields under user edit.

This method works completely without plugins and involves just some functions and hooks in functions.php. Plugins like "User Meta Display" achieve this to some level, but treat custom meta fiedlds completely different from the regular fields. They are shown and edited in seperate environment and fail to show the meta data is a table list. This method integrates custom user meta along with regular user (meta).

@gigo6000
gigo6000 / Vagrantfile
Created January 28, 2019 22:01
Vagrantfile use NFS
### Uncomment the following lines to use NFS:
config.vm.synced_folder ".", "/vagrant",
id: "core",
:nfs => true
config.vm.network :private_network, ip: '192.168.50.4'
@gigo6000
gigo6000 / Projects.js
Created September 29, 2018 15:18
Loop Array inside Array with map() function in React Component
import React, {Component} from 'react';
class Projects extends Component {
state = {
projects: [
{
id: 1,
title: 'Residencia Unifamiliar',
client: 'Familia León',
location:
Vagrant.configure('2') do |config|
# Every Vagrant virtual environment requires a box to build off of.
config.vm.box = 'precise64'
config.vm.box_url = 'http://files.vagrantup.com/precise64.box'
# nfs - Important: this helps to reduce the page load time. It should be enabled by default even if it's ignored for Windows users
config.vm.synced_folder '.', '/vagrant', type: 'nfs'
config.vm.network :private_network, ip: '192.168.50.4'
config.vm.provider :virtualbox do |vb|
vb.customize ["modifyvm", :id, "--memory", "2048"]
@gigo6000
gigo6000 / gist:1342b0b8bdc0456105ad23cab2542652
Created November 14, 2017 22:56
local.phpcali.com.conf
<VirtualHost *:80>
ServerName local.phpcali.com
DocumentRoot /vagrant/public
<Directory /vagrant/public>
AllowOverride All
Require all granted
</Directory>
# uncomment the following lines if you install assets as symlinks
@gigo6000
gigo6000 / gist:1354241
Created November 10, 2011 06:12
Twitter button Twig
{% if is_granted('IS_AUTHENTICATED_FULLY') %}
<a href="{{ path('_security_logout')}}"><img src="/images/twitterLogOutButton.png"></a>
{% else %}
<a href="{{ path ('connect_twitter')}}"> <img src="/images/twitterLoginButton.png"></a>
{% endif %}
@gigo6000
gigo6000 / gist:1354239
Created November 10, 2011 06:10
Connect to twitter
/**
* @Route("/connectTwitter", name="connect_twitter")
*
*/
public function connectTwitterAction()
{
$request = $this->get('request');
$twitter = $this->get('fos_twitter.service');
@gigo6000
gigo6000 / TwitterProvider.php
Created November 10, 2011 05:52
Symfony2 FOSTwitter TwitterProvider
namespace Social\SiteBundle\Security\User\Provider;
use Symfony\Component\Security\Core\Exception\UsernameNotFoundException;
use Symfony\Component\Security\Core\Exception\UnsupportedUserException;
use Symfony\Component\Security\Core\User\UserProviderInterface;
use Symfony\Component\Security\Core\User\UserInterface;
use Symfony\Component\DependencyInjection\Container;
use FOS\TwitterBundle\Services\Twitter;
@gigo6000
gigo6000 / staging.rb
Created June 29, 2011 03:18
Capifony task to send the email
namespace :deploy do
desc "Send notification email"
task :sendemail do
run("cd #{deploy_to}/current && php app/console deploy:sendemail emailfrom@server.com emailto@server.com \"Deploy Complete.\" ")
end
end
after 'deploy:restart', 'deploy:sendemail'