Skip to content

Instantly share code, notes, and snippets.

View alisonmonteiro's full-sized avatar
:shipit:
Focusing

Alison Monteiro alisonmonteiro

:shipit:
Focusing
View GitHub Profile
@atifaziz
atifaziz / emojis.json
Created September 24, 2015 17:43
JSON response from https://api.github.com/emojis stored in EmojiStore as emojis.json and used by EmojiVS
{
"+1": "https://assets-cdn.github.com/images/icons/emoji/unicode/1f44d.png?v5",
"-1": "https://assets-cdn.github.com/images/icons/emoji/unicode/1f44e.png?v5",
"100": "https://assets-cdn.github.com/images/icons/emoji/unicode/1f4af.png?v5",
"1234": "https://assets-cdn.github.com/images/icons/emoji/unicode/1f522.png?v5",
"8ball": "https://assets-cdn.github.com/images/icons/emoji/unicode/1f3b1.png?v5",
"a": "https://assets-cdn.github.com/images/icons/emoji/unicode/1f170.png?v5",
"ab": "https://assets-cdn.github.com/images/icons/emoji/unicode/1f18e.png?v5",
"abc": "https://assets-cdn.github.com/images/icons/emoji/unicode/1f524.png?v5",
"abcd": "https://assets-cdn.github.com/images/icons/emoji/unicode/1f521.png?v5",
@abogawat
abogawat / gist:5353764
Last active March 19, 2019 05:00
[HTML: Better YouTube embed code] #html
<div class="youtube" id="LcIytqkbdlo" style="width: 320px; height: 180px;"></div>
<script src="https://labnol.googlecode.com/files/youtube.js"></script>
@sibelius
sibelius / config.ts
Created July 1, 2019 15:23
Keep all your process.env in a config file, so it is easy to check env vars available
const config = {
GRAPHQL_URL: process.env.GRAPHQL_URL,
A: process.env.A,
};
export default config;
@nunomorgadinho
nunomorgadinho / gist:b2d8e5b8f5fec5b0ed946b24fa288a91
Created February 10, 2017 13:30
PHPCS + WordPress Coding Standards
# Install brew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# Install composer
brew install homebrew/php/composer
### PHPCS
composer global require "squizlabs/php_codesniffer=*"
# Add to your .bash_profile
@sgelbart
sgelbart / firebase-example.html
Created December 10, 2017 22:39
A simple firebase example for reading and writing database records realtime.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Order Form</title>
@fdemiramon
fdemiramon / pre-commit
Created May 12, 2015 19:13
Pre-commit hook for git with phpcs and phpcbf (auto-correct obvious violations)
#!/bin/sh
PROJECT=`php -r "echo dirname(dirname(dirname(realpath('$0'))));"`
STAGED_FILES_CMD=`git diff --cached --name-only --diff-filter=ACMR HEAD | grep \\\\.php`
# Determine if a file list is passed
if [ "$#" -eq 1 ]
then
oIFS=$IFS
IFS='
@tarolandia
tarolandia / placeholder-color.sass
Created April 22, 2013 12:33
Sass: mixin that let you change placeholder font color.
@mixin placeholder-color($color) {
&::-webkit-input-placeholder { /* WebKit browsers */
color: $color;
}
&:-moz-placeholder { /* Mozilla Firefox 4 to 18 */
color: $color;
}
&::-moz-placeholder { /* Mozilla Firefox 19+ */
color: $color;
}
@kucrut
kucrut / nav-menu-item-custom-fields.php
Created September 29, 2012 15:39 — forked from westonruter/nav-menu-item-custom-fields.php
Proof of concept for how to add new fields to nav_menu_item posts in the WordPress menu editor.
<?php
/**
* Proof of concept for how to add new fields to nav_menu_item posts in the WordPress menu editor.
* @author Weston Ruter (@westonruter), X-Team
*/
add_action( 'init', array( 'XTeam_Nav_Menu_Item_Custom_Fields', 'setup' ) );
class XTeam_Nav_Menu_Item_Custom_Fields {
static $options = array(
@teeli
teeli / codedeploy-to-slack.js
Last active October 13, 2022 13:18
CodeDeploy notifications to Slack (AWS Lambda via SNS)
var https = require('https');
var util = require('util');
exports.handler = function (event, context) {
console.log(JSON.stringify(event, null, 2));
console.log('From SNS:', event.Records[0].Sns.Message);
var severity = "good";
var message = event.Records[0].Sns.Message;
var messageJSON = JSON.parse(message);
@georgybu
georgybu / content-single-product.php
Created December 14, 2012 12:09
WooCommerce - Show next\prev products from current product category (when viewing a single product) 1. If product is last -> Next product is first 2. If product is first -> Prev product is last forked from https://gist.github.com/2176823 (This question was in http://stackoverflow.com/questions/13597687/woocommerce-get-next-previous-product/13612387
<?php
// get next and prev products
// Author: Georgy Bunin (bunin.co.il@gmail.com)
// forked from https://gist.github.com/2176823
function ShowLinkToProduct($post_id, $categories_as_array, $label) {
// get post according post id
$query_args = array( 'post__in' => array($post_id), 'posts_per_page' => 1, 'post_status' => 'publish', 'post_type' => 'product', 'tax_query' => array(
array(
'taxonomy' => 'product_cat',