Skip to content

Instantly share code, notes, and snippets.

View mitogh's full-sized avatar
:octocat:
I may be slow to respond.

Crisoforo Gaspar Hernández mitogh

:octocat:
I may be slow to respond.
View GitHub Profile
<?
//
// AUTO KEYWORD-BASED FOLLOWER CURATION BOT (by @levelsio)
//
// File: twitterFollowerCuratorBot.php
//
// Created: May 2021
// License: MIT
//
dialog {
position: fixed;
top: 50%;
left: 50%;
right: auto;
padding: 30px;
transform: perspective(500px) translate(-50%, -50%);
background: linear-gradient(to bottom, #FFF, #F4F4F4) #FFF;
border: none;
border-radius: 3px;
@raftaar1191
raftaar1191 / functions.php
Created August 29, 2017 19:07
Adding script with Shortcode
<?php
/**
* Register Scripts
*
*/
function be_register_scripts() {
wp_register_style( 'be-shortcode', get_stylesheet_directory_uri() . '/assets/css/shortcode.css' );
wp_register_style( 'be-shortcode-color1', get_stylesheet_directory_uri() . '/assets/css/color1-shortcode.css' );
wp_register_style( 'be-shortcode-color2', get_stylesheet_directory_uri() . '/assets/css/color2-shortcode.css' );
@notwaldorf
notwaldorf / 👀.md
Last active February 18, 2024 21:13
Advice for new developers

Someone sent me an email asking me what advice I had for new developers. I get this question a bunch, so I wanted to put all my thoughts in one place, that I can update as I get more ideas!

I answered this a bunch on my AMA repo, so here's some initial general answers, before I get to some of the specific questions:

FWIW: I (@rondy) am not the creator of the content shared here, which is an excerpt from Edmond Lau's book. I simply copied and pasted it from another location and saved it as a personal note, before it gained popularity on news.ycombinator.com. Unfortunately, I cannot recall the exact origin of the original source, nor was I able to find the author's name, so I am can't provide the appropriate credits.


Effective Engineer - Notes

What's an Effective Engineer?

@timoxley
timoxley / Readme.md
Last active June 7, 2016 07:27
JS Pop Quiz: How well do you know your functions?

JS Pop Quiz: How well do you know your functions?

Given an Array of Functions fns, what argument(s) can you pass to fns.forEach such that each function in fns will execute, in order, without creating any anonymous (or named) functions or invoking the Function constructor?

Conditions

  • Do not use the function keyword, or arrow functions () => .
  • Do not invoke the Function constructor.
  • Do not use method definitions.
  • Function#bind & friends on the Function.prototype are ok.
@hdragomir
hdragomir / sm-annotated.html
Last active March 5, 2024 08:57
The deferred font loading logic for Smashing Magazine. http://www.smashingmagazine.com/
<script type="text/javascript">
(function () {
"use strict";
// once cached, the css file is stored on the client forever unless
// the URL below is changed. Any change will invalidate the cache
var css_href = './index_files/web-fonts.css';
// a simple event handler wrapper
function on(el, ev, callback) {
if (el.addEventListener) {
el.addEventListener(ev, callback, false);
@timmcdaniels
timmcdaniels / populate_acf_select_fields
Last active May 6, 2020 15:30
Populating ACF Select Fields with Post Type Values
// populate acf field (sample_field) with post types (sample_post_type)
function acf_load_sample_field( $field ) {
$field['choices'] = get_post_type_values( 'sample_post_type' );
return $field;
}
add_filter( 'acf/load_field/name=sample_field', 'acf_load_sample_field' );
function get_post_type_values( $post_type ) {
$values = array();
@paul91
paul91 / pecl-memcached.sh
Created May 5, 2014 14:33
How to install php memcached on CentOS 6.5
#!/bin/bash
# How to install PHP memcached on CentOS 6.5
# Install dependencies
yum install cyrus-sasl-devel zlib-devel gcc-c++
# Get the latest libmemcached
wget https://launchpad.net/libmemcached/1.0/1.0.16/+download/libmemcached-1.0.16.tar.gz
tar -xvf libmemcached-1.0.16.tar.gz
@gvn
gvn / code-smell.md
Last active June 16, 2021 09:02
Eliminating Code Smell With Grunt

Eliminating Code Smell With Grunt

by Gavin Lazar Suntop @gvn

Intro

I love clean code. There, I said it. I pride myself on passing strict linting standards and keeping my code easy to read. It's not just a personal proclivity, but a choice I hope benefits other developers.

My general experience with teams has been that code style is something people care about and have strong personal preferences. Typically, at some point people get tired of dealing with inconsistency and a standardization meeting is called. This is, of course, an important discussion to have. The problem that tends to occur is either lack of documentation or lack of enforcement of the agreed upon style. Additionally, new team members or contributors may not have access to a clear set of rules.