Skip to content

Instantly share code, notes, and snippets.

View luco's full-sized avatar
🏠
Working from home

Lucas Veiga luco

🏠
Working from home
View GitHub Profile
@diego3g
diego3g / settings.json
Last active May 13, 2024 00:31
VSCode Settings (Updated)
{
"workbench.startupEditor": "newUntitledFile",
"editor.fontSize": 14,
"editor.lineHeight": 1.8,
"javascript.suggest.autoImports": true,
"javascript.updateImportsOnFileMove.enabled": "always",
"editor.rulers": [80, 120],
"extensions.ignoreRecommendations": true,
"typescript.tsserver.log": "off",
"files.associations": {
@JoeShi
JoeShi / kms-demo.js
Created October 30, 2018 16:04
KMS demo using node.js
/**
* This is a demo of KMS.
*
* This demo includes the following two features:
* 1. encrypt and decrypt using CMK (Customer Master Key)
* 2. encrypt and decrypt using data key (Envelope encryption using AWS KMS)
*
*/
'use strict';
@jessepearson
jessepearson / adding_new_webhook_topics.php
Last active May 12, 2024 19:33
How to add a new custom Webhook topic in WooCommerce, with example of order filtering.
<?php // do not copy this line
/**
* add_new_topic_hooks will add a new webhook topic hook.
* @param array $topic_hooks Esxisting topic hooks.
*/
function add_new_topic_hooks( $topic_hooks ) {
// Array that has the topic as resource.event with arrays of actions that call that topic.
@wesleybliss
wesleybliss / docker-compose-node-mongo.yml
Created September 9, 2016 21:37
Docker Compose with example App & Mongo
version: '2'
services:
myapp:
build: .
container_name: "myapp"
image: debian/latest
environment:
- NODE_ENV=development
- FOO=bar
volumes:
@mattes
mattes / og.txt
Last active May 7, 2022 01:53
Open Graph debugger
http://ogp.me/
https://moz.com/blog/meta-data-templates-123
https://search.google.com/structured-data/testing-tool
https://developers.facebook.com/tools/debug/og/object - https://developers.facebook.com/docs/reference/opengraph
https://cards-dev.twitter.com/validator - https://dev.twitter.com/cards/types
https://developers.pinterest.com/tools/url-debugger/ - https://developers.pinterest.com/docs/rich-pins/overview/
https://developer.linkedin.com/docs/share-on-linkedin
@daronco
daronco / letsencrypt-webroot-apache.md
Last active February 15, 2024 11:50
Letsencrypt with webroot on Apache

Config Apache with /etc/apache2/conf-available/le.conf:

Alias /.well-known/acme-challenge/ "/var/www/html/.well-known/acme-challenge/"
<Directory "/var/www/html/">
    AllowOverride None
    Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
    Require method GET POST OPTIONS
</Directory>
@mmazzarolo
mmazzarolo / Appfile
Created May 17, 2016 11:27
Simple Fastlane setup for React-Native (Android - iOS)
# iOS
app_identifier "com.myapp.app" # The bundle identifier of your app
apple_id "me@gmail.com" # Your Apple email address
team_id "1234ABCD" # Developer Portal Team ID
# Android
json_key_file "./google-play-api-secret.json" # Path to the json secret file - Follow https://github.com/fastlane/supply#setup to get one
package_name "com.myapp.app" # Your Android app package
@reggi
reggi / socket-io-emit-async.js
Last active August 30, 2019 16:42
Socket.io emit async
var io = require('socket.io-client')("http://localhost:3001")
var Promise = require("bluebird")
io.emitAsync = Promise.promisify(io.emit)
io.emitAsync("report", {
"name": "thomas"
}).then(function(data){
console.log(data)
}).catch(function(e){
console.log(e.message)
@andrezrv
andrezrv / varnish-purge-cache.sh
Created November 2, 2013 06:07
Purge all Varnish cache.
# Purge all Varnish cache
varnishadm "ban req.url ~ /"
@eljamez
eljamez / functions.php
Created August 28, 2013 17:49
Woocommerce, get the product's attribute title from attribute slug
// just pass in the attribute and the attribute slug
// and the return value is the attribute's name
// example : (assuming attribute size has the option of "Extra Small" withe the slug of "extra-small")
// echo attribute_slug_to_title('attribute_pa_size', 'extra-small');
// returns
// "Extra Small"
// code reworked from woocommerce/classes/class-wc-cart.php