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
@rhaseven7h
rhaseven7h / devise.es.yml
Created October 20, 2011 20:11
i18n Translation Spanish Mexican - Devise 1.4.8
# Additional translations at http://github.com/plataformatec/devise/wiki/I18n
es:
errors:
messages:
expired: "ha expirado, por favor pida uno nuevo"
not_found: "no encontrado"
already_confirmed: "ya está confirmada, por favor intente ingresar"
not_locked: "no está bloqueada"
not_saved:
@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.
@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' );
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;
@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();
@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.

@JamesDullaghan
JamesDullaghan / digitalocean.md
Created July 6, 2013 20:54
Deploy rails app to digitalocean with nginx, unicorn, capistrano & postgres

Deploy Rails app to digitalocean with nginx, unicorn, capistrano & postgres

Create droplet of your liking (ubuntu 12.10 x32)

ssh to root in terminal with your server ip

ssh root@123.123.123.123

Add ssh fingerprint and enter password provided in email

@eddarmitage
eddarmitage / InstallingGitUsingYum.md
Created March 8, 2012 14:03
Installing git on CentOS 5 using yum

Installing git on CentOS 5 using yum

Since you're using CentOS 5, the default package manager is yum, not apt-get. To install a program using it, you'd normally use the following command:

$ sudo yum install <packagename>

However, when trying to install git this way, you'll encounter the following error on CentOS 5:

@desandro
desandro / bower-logo.md
Last active December 30, 2021 23:11
Bower logo

In addition to awesome docs #228, Bower deserves a proper logo. See below for sketches. I'm curious if you think any of these are worth me putting more effort into.


Take a look at Yeoman right now.

Screen Shot 2013-02-19 at 4 43 10 PM

The other two entities have awesome logos. Bower's got to represent.

@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