Skip to content

Instantly share code, notes, and snippets.

View Mario-Duarte's full-sized avatar
:shipit:
Starting a new position

Mario Duarte Mario-Duarte

:shipit:
Starting a new position
View GitHub Profile
@dannote
dannote / final-cut-pro-trial-reset.swift
Last active October 24, 2025 07:34
Final Cut Pro X trial reset
#!/usr/bin/swift
// DISCLAIMER
// This script modifies an unencrypted file associated with the trial version of Final Cut Pro.
// Under the DMCA (17 U.S.C. § 1201), this modification does not qualify as circumvention of a technological
// protection measure (TPM), as it does not involve bypassing encryption, authentication, or similar protections.
// Distributing this code is therefore legal under the DMCA.
// This script is intended for educational and research purposes, such as exploring trial-related file structures,
@apisandipas
apisandipas / share-urls.md
Last active August 3, 2025 16:23 — forked from chrisl8888/drupal-views-share-global-text-field
Share url's for Facebook, Twitter, Pinterest and Linkedin with just get variables

Creating share buttons with just URL's

Twitter

http://twitter.com/share?text=<TITLE>&url=<URL>

E.g. http://twitter.com/share?text=This+is+google+a+search+engine&url=https%3A%2F%2Fwww.google.com

Facebook

http://www.facebook.com/sharer.php?u=&amp;p[title]=

@ggeorgaras
ggeorgaras / gist:56e37c830c0837aac7dace1765b45b97
Created April 8, 2016 07:12
Shared upload folder in wordpress multisite
/**
* Force all network uploads to reside in "wp-content/uploads", and by-pass
* "files" URL rewrite for site-specific directories.
*
* @link http://wordpress.stackexchange.com/q/147750/1685
*
* @param array $dirs
* @return array
*/
function wpse_147750_upload_dir( $dirs ) {
@jtsternberg
jtsternberg / colliding.js
Last active August 12, 2024 17:52 — forked from JayWood/colliding.js
Detect if two elements are colliding/overlapping
/**
* Detects if two elements are colliding
*
* Credit goes to BC on Stack Overflow, cleaned up a little bit
*
* @link http://stackoverflow.com/questions/5419134/how-to-detect-if-two-divs-touch-with-jquery
* @param $div1
* @param $div2
* @returns {boolean}
*/
@iNaD
iNaD / request_no_curl.php
Last active February 29, 2024 09:37
Sending a GET/POST Request via PHP without CURL (fopen needs to be enabled)
<?php
$url = 'http://server.com/path';
$data = array('key1' => 'value1', 'key2' => 'value2');
// use key 'http' even if you send the request to https://...
$options = array(
'http' => array(
'header' => "Content-type: application/x-www-form-urlencoded\r\n",
'method' => 'POST',
'content' => http_build_query($data),
@ihorvorotnov
ihorvorotnov / wp-get-content
Created February 21, 2014 11:20
WordPress: get post content by ID
/**
* You often need to get the content or title from a specific post.
* Sometimes, using a custom loop is the better option, but when you only need
* to get information from a specific post, there’s a better option
*/
echo get_post_field('post_content', $post_id);
@carlesjove
carlesjove / custom_wp_gallery
Last active November 28, 2018 17:18
Custom gallery markup for WordPress. Put this un functions.php and it will override the default shortcode.
@andrebaptista
andrebaptista / example.php
Last active October 28, 2016 19:05 — forked from mloberg/example.php
Correcting sending emails with html, because the function json_encode when content has html code, it is set to null
<?php
require("postmark.php");
$postmark = new Postmark("your-api-key","from-email","optional-reply-to-address");
if($postmark->to("[email protected]")->subject("Email Subject")->html_message("<p style='color: red'>Test mail</p>")->send()){
echo "Message sent";
}
@corsonr
corsonr / Add CPTs to search
Created October 13, 2012 09:54
Add CPTs to search
@kflorence
kflorence / scrollbarWidth.js
Created July 10, 2012 22:13
Calculate scroll bar width cross-browser
function getScrollBarWidth() {
var inner = document.createElement('p');
inner.style.width = "100%";
inner.style.height = "200px";
var outer = document.createElement('div');
outer.style.position = "absolute";
outer.style.top = "0px";
outer.style.left = "0px";
outer.style.visibility = "hidden";