This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Based on https://djangosnippets.org/snippets/2283/ | |
from django.db import transaction | |
from django.db.models import get_models, Model | |
from django.contrib.contenttypes.generic import GenericForeignKey | |
@transaction.atomic | |
def merge_model_objects(primary_object, alias_objects=None, keep_old=False): | |
""" | |
Use this function to merge model objects (i.e. Users, Organizations, Polls, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# scrapyd This shell script enables scrapyd server on boot | |
# | |
# Author: Aaron Silber <aaron@brandthropology.com> | |
# | |
# chkconfig: - 50 01 | |
# | |
# description: Autostart scrapyd web scraper framework daemon | |
# processname: scrapyd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.db import transaction | |
from django.apps import apps | |
from django.contrib.contenttypes.fields import GenericForeignKey | |
from django.db.models.fields.related import ManyToManyField | |
@transaction.atomic() | |
def merge(primary_object, *alias_objects): | |
"""Merge several model instances into one, the `primary_object`. | |
Use this function to merge model objects and migrate all of the related |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//**NOTE**: This has *NOT* been tested yet; please provide feedback in the comments | |
//Drop-in replacement for PHP's SoapClient class supporting connect and response/transfer timeout and authentication | |
//Usage: Exactly as PHP's SoapClient class, except that some new options are available: | |
// timeout The response/transfer timeout in milliseconds; 0 == default SoapClient / CURL timeout | |
// connecttimeout The connection timeout; 0 == default SoapClient / CURL timeout | |
// sslverifypeer FALSE to stop SoapClient from verifying the peer's certificate | |
// sslversion The SSL version (2 or 3) to use. By default PHP will try to determine this itself, although in some cases this must be set manually | |
// sslverifyhost 1 to check the existence of a common name in the SSL peer certificate. 2 to check the existence of a common name and also verify that |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"presets": ["env"] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
EXAMPLE="example default" | |
# Plugin variable description | |
PROGNAME=$(basename $0) | |
RELEASE="Revision 1.0.0" | |
AUTHOR="(c) 2020 Warlord0" | |
# Functions plugin usage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Queue class for serializing AJAX calls. | |
// | |
// Inspired by Raynos http://stackoverflow.com/a/4797596/1194060 | |
// | |
// Queue has a public append method that expects some kind of task. | |
// A task is a generic function passed as callback. | |
// Constructor expects a handler which is a method that takes a ajax task | |
// and a callback. Queue expects the handler to deal with the ajax and run | |
// the callback when it's finished |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
xdebug.auto_trace=1 | |
;;Type: boolean, Default value: 0 | |
;;When this setting is set to on, the tracing of function calls will be enabled just before the script is run. This makes it possible to trace code in the auto_prepend_file. | |
xdebug.cli_color=1 | |
;;Type: integer, Default value: 0, Introduced in Xdebug 2.2 | |
;;If this setting is 1, Xdebug will color var_dumps and stack traces output when in CLI mode and when the output is a tty. On Windows, the ANSICON tool needs to be installed. | |
;;If the setting is 2, then Xdebug will always color var_dumps and stack trace, no matter whether it's connected to a tty or whether ANSICON is installed. In this case, you might end up seeing escape codes. | |
;xdebug.collect_assignments=0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Console\Commands; | |
use Illuminate\Console\Command; | |
use Illuminate\Filesystem\Filesystem; | |
class CollectionCommand extends Command | |
{ | |
protected $signature = 'make:collection {model}'; |
OlderNewer