Skip to content

Instantly share code, notes, and snippets.

This file has been truncated, but you can view the full file.
@1844144
1844144 / 11.txt
Created February 5, 2020 08:26
11
https://drive.google.com/folderview?id=1B-OfSxlbRYEseZrM1Jvn_4mEfLokcscd
@1844144
1844144 / part.py
Last active January 4, 2019 13:59
# It was helpful for me when I have to provide
for class_name in models.autogenerate:
serializer_name = class_name+'Serializer'
view_name = class_name+'SetAuto'
globals()[view_name] = type(
view_name,
(viewsets.ModelViewSet,),
{
@1844144
1844144 / create_entry.php
Last active May 30, 2023 14:09
Formidable Forms: Create Entry, Update metas for existing entry
<?
$arg = array(
'form_id' => $opts['subscription_form'],
'item_key' => FrmAppHelper::get_unique_key(
'', $pre . 'frm_items', 'item_key', 0 ),
'item_meta' => array(
$opts['subscription_id'] => $payment->response->getSubscriptionId(),
$opts['subscription_pre_payment_id'] => $payment->entry->id,
$opts['subscription_date'] => $metas[$opts['recur_date']],
$opts['subscription_amount'] => $metas[$opts['recur_amount']],
select it.id as 'ID(child)',
it.parent_item_id as 'Parent ID',
parA.meta_value as 'Payment status(parent)',
parB.meta_value as 'Reg phase',
col0.meta_value as 'Attendee status',
colA.meta_value as 'First Name',
colB.meta_value as 'Last Name',
colC.meta_value as 'ASI Member',
COALESCE(
@1844144
1844144 / part1.html
Created July 2, 2017 10:07
How to add exhibitor map (formidable, wordpress)
<!--1) include something like that in your form or registration page -->
<a href='' class='show-exhibitor-map'><h4><span style="color:red;">IMPORTANT:</span> Select your booth here.</h4></a>
<!-- For exhibitor map -->
<div class='map-container'><div class='the-page'></div> </div>
<!-- End exhibitor map -->
@1844144
1844144 / createdb.sh
Created February 15, 2016 06:17
Create Mysql Database, Add User, Grant permissions
#!/bin/bash
EXPECTED_ARGS=3
E_BADARGS=65
MYSQL=`which mysql`
Q1="CREATE DATABASE IF NOT EXISTS $1;"
Q2="GRANT USAGE ON *.* TO $2@localhost IDENTIFIED BY '$3';"
Q3="GRANT ALL PRIVILEGES ON $1.* TO $2@localhost;"
Q4="FLUSH PRIVILEGES;"
@1844144
1844144 / gist.py
Last active January 8, 2016 13:42
Add TM
import argparse
import subprocess
import os
import sys
import BaseHTTPServer
from SimpleHTTPServer import SimpleHTTPRequestHandler
import requests
from lxml import etree
@1844144
1844144 / slider_list.php
Created December 20, 2015 15:57
LayerSlider WP Kreature Media bug with "Use Cache" option
To fix option true to FALSE changed in this line of views/slider_list.php
<td><input type="checkbox" name="use_cache" <?php echo get_option('ls_use_cache', false) ? 'checked="checked"' : '' ?>></td>