Skip to content

Instantly share code, notes, and snippets.

View carmolim's full-sized avatar

Augusto Carmo carmolim

View GitHub Profile
@whiskerz007
whiskerz007 / gist:53c6aa5d624154bacbbc54880e1e3b2a
Last active August 14, 2024 17:16
How to setup a community version of Proxmox VE 5.x-6.x
# Disable Commercial Repo
sed -i "s/^deb/\#deb/" /etc/apt/sources.list.d/pve-enterprise.list
apt-get update
# Add PVE Community Repo
echo "deb http://download.proxmox.com/debian/pve $(grep "VERSION=" /etc/os-release | sed -n 's/.*(\(.*\)).*/\1/p') pve-no-subscription" > /etc/apt/sources.list.d/pve-no-enterprise.list
apt-get update
# Remove nag
echo "DPkg::Post-Invoke { \"dpkg -V proxmox-widget-toolkit | grep -q '/proxmoxlib\.js$'; if [ \$? -eq 1 ]; then { echo 'Removing subscription nag from UI...'; sed -i '/data.status/{s/\!//;s/Active/NoMoreNagging/}' /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js; }; fi\"; };" > /etc/apt/apt.conf.d/no-nag-script
@fredfontes
fredfontes / index.markdown
Created April 26, 2018 17:58
Integrações RD Station - HTML e Ajax com jQuery

Integrações RD Station

HTML e Ajax com jQuery

Formulário HTML

Crie normalmente um formulário com os campos que desejar, mas tendo sempre o campo email ou email_lead que é obrigatório.

É necessário também que o formulário tenha o atributo id como conversion-form.

É possível utilizar uma lista de outros campos já cadastrados na ferramenta de CRM do RD Station. Segue uma breve lista de opções:

  • nome
  • telefone
  • empresa
  • cargo
  • twitter
  • etc

// https://webreflection.medium.com/using-the-input-datetime-local-9503e7efdce
Date.prototype.toDatetimeLocal =
function toDatetimeLocal() {
var
date = this,
ten = function (i) {
return (i < 10 ? '0' : '') + i;
},
YYYY = date.getFullYear(),
MM = ten(date.getMonth() + 1),
@kblum
kblum / google-earth-dropbox-sync.md
Created October 13, 2016 20:22
Google Earth Dropbox Sync

Google Earth - Dropbox Sync

Synchronise Google Earth places across multiple computers using Dropbox. The instructions are currently specific to OS X but can be extended to Windows and Linux.

Process Description

The ~/Library/Application\ Support/Google\ Earth is moved to a google-earth-sync directory under a Dropbox container directory. A symbolic link is then made to this directory.

The entire Google Earth data directory needs to be synchronised instead of just the myplaces.xml file because of how Google Earth backs the file up. During the backup process after quitting Google Earth, myplaces.kml is renamed to myplaces.backup.kml and then copied to myplaces.kml. If only the myplaces.kml file were to be synchronised with a symbolic link then the synchronisation process would break after one cycle because the backup file would then be the symbolic link.

@sc0ttkclark
sc0ttkclark / add-product-to-cart.php
Last active March 5, 2020 08:28 — forked from kloon/gist:2376300
WooCommerce Automatically add product to cart on site visit
<?php
/*
* This code goes into theme functions.php or a custom plugin
*/
/**
* Add product to cart on page load
*/
function add_product_to_cart() {
@ayamflow
ayamflow / gist:b602ab436ac9f05660d9c15190f4fd7b
Created May 9, 2016 19:10
Safari border-radius + overflow: hidden + CSS transform fix
// Add on element with overflow
-webkit-mask-image: -webkit-radial-gradient(white, black);
@bekarice
bekarice / edit-woocommerce-checkout-template.php
Last active September 5, 2024 01:24
Add content and notices to the WooCommerce checkout - sample code
/**
* Each of these samples can be used - note that you should pick one rather than add them all.
*
* How to use WC notices: https://github.com/woothemes/woocommerce/blob/master/includes/wc-notice-functions.php#L96
* Tutorial: http://www.skyverge.com/blog/edit-woocommerce-templates/
**/
/**
* Add a content block after all notices, such as the login and coupon notices.
*
<?php
/**
* Join a string with a natural language conjunction at the end.
*/
function natural_language_join(array $list, $conjunction = 'and') {
$last = array_pop($list);
if ($list) {
return implode(', ', $list) . ' ' . $conjunction . ' ' . $last;
}
return $last;
@alexstone
alexstone / slack_notification.php
Created March 3, 2014 06:54
Fire a Slack Notification via CURL
<?php
// (string) $message - message to be passed to Slack
// (string) $room - room in which to write the message, too
// (string) $icon - You can set up custom emoji icons to use with each message
public static function slack($message, $room = "engineering", $icon = ":longbox:") {
$room = ($room) ? $room : "engineering";
$data = "payload=" . json_encode(array(
"channel" => "#{$room}",
"text" => $message,
@KartikTalwar
KartikTalwar / Documentation.md
Last active August 11, 2024 01:52
Rsync over SSH - (40MB/s over 1GB NICs)

The fastest remote directory rsync over ssh archival I can muster (40MB/s over 1gb NICs)

This creates an archive that does the following:

rsync (Everyone seems to like -z, but it is much slower for me)

  • a: archive mode - rescursive, preserves owner, preserves permissions, preserves modification times, preserves group, copies symlinks as symlinks, preserves device files.
  • H: preserves hard-links
  • A: preserves ACLs