Skip to content

Instantly share code, notes, and snippets.

View mager19's full-sized avatar

Mario Germán Reyes C mager19

View GitHub Profile
<snippet>
<content><![CDATA[
@include media-breakpoint-down(${1:md}){
$2
}
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>ind</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<!-- <scope>source.python</scope> -->
function getTeamMembers()
{
$args = array('post_type' => 'team', 'posts_per_page' => -1);
// Run a custom query
$loop = new WP_Query($args);
if ($loop->have_posts()) {
$i = 0;
$data = array();
/Applications/OBS.app/Contents/MacOS/OBS; exit
@mager19
mager19 / config visual code
Created October 9, 2020 17:07
backup visual
test
10k e951
10mp e952
11mp e953
12mp e954
13mp e955
14mp e956
15mp e957
16mp e958
17mp e959
18mp e95a
@mager19
mager19 / functions.php
Created June 3, 2021 20:35
send email on time check
add_action('gform_after_submission', 'set_post_content', 10, 2);
function set_post_content($entry, $form)
{
//vars
$id = $entry['form_id'];
if ($id == '3' || $id == '1' || $id == '10' || $id == '16') {
$date = new DateTime();
$date->setTimezone(new DateTimeZone('America/Chicago'));
@mager19
mager19 / functions.php
Created March 31, 2022 14:52
assing value to hidden field pre submittion
add_filter("gform_pre_submission_1", "obtainsumvaluesfield", 1);
function obtainsumvaluesfield($form)
{
// get all entries in this form
$entry = GFFormsModel::get_current_lead();
$all = 0;
foreach ($form["fields"] as &$field)
if ($field->type == 'checkbox') {
@mager19
mager19 / populate
Created May 9, 2022 19:49
populate a field, el 'emaito' es el parametro de populate q se setea.
add_filter('gform_field_value_emailto', 'add_job_email');
function add_job_email($value)
{
global $post;
$id = $post->id;
$email = get_field('email_to', $id);
return $email;
}
alias cl="clear"
alias dev="ssh -tp 22 frontpor@64.227.12.223 'cd webapps; bash'"
alias rc1="ssh -tp 22 frontpor@165.227.122.237 'cd webapps; bash'"
alias rc2="ssh -tp 22 frontpor@167.99.224.167 'cd webapps; bash'"
alias rc3="ssh -tp 22 frontpor@157.245.138.99 'cd webapps; bash'"
alias rc4="ssh -tp 22 frontpor@142.93.193.237 'cd webapps; bash'"
alias rc5="ssh -tp 22 frontpor@161.35.105.105 'cd webapps; bash'"
alias rc6="ssh -tp 22 frontpor@134.122.9.188 'cd webapps; bash'"
alias sp5="ssh -tp 22 frontpor@67.205.141.186 'cd apps; bash'"
alias sp3="ssh -tp 22 frontpor@67.205.153.98 'cd apps; bash'"
@mager19
mager19 / gist:6f5b977e8dcc1a340729e19ea54ac4a9
Created December 20, 2022 20:21
Reverse query relationship acf field
//obtain pages or post who added a relationship item - Reverse relationship posts
$tasks = get_posts(array(
'post_type' => 'task',
'meta_query' => array(
array(
'key' => 'task_parents', // name of custom field
'value' => '"' . get_the_ID() . '"', // matches exaclty "123", not just 123. This prevents a match for "1234"
'compare' => 'LIKE'
)