Skip to content

Instantly share code, notes, and snippets.

View smant's full-sized avatar
🎯
Focusing

smant

🎯
Focusing
  • Getwebcraft Limited
View GitHub Profile
@smant
smant / ticimax-cart-watcher.js
Last active March 4, 2022 09:10
Getsitecontrol Ticimax cart watcher
function cartWatcher(cb){
function getCartParams(){
let ctp,cc
try{
c = window.cart.get.model.cart
ctp = parseFloat(c.totalAmountStr.replaceAll(/[^\d\.\,]/,''))
cc = c.products[0].currency
}catch{}
return {
cartTotalPrice: ctp,
@smant
smant / free_email_provider_domains.txt
Created July 20, 2020 16:13 — forked from tbrianjones/free_email_provider_domains.txt
A list of free email provider domains. Some of these are probably not around anymore. I've combined a dozen lists from around the web. Current "major providers" should all be in here as of the date this is created.
1033edge.com
11mail.com
123.com
123box.net
123india.com
123mail.cl
123qwe.co.uk
126.com
150ml.com
15meg4free.com
@smant
smant / temporary-email-address-domains
Created April 13, 2020 19:13 — forked from adamloving/temporary-email-address-domains
A list of domains for disposable and temporary email addresses. Useful for filtering your email list to increase open rates (sending email to these domains likely will not be opened).
0-mail.com
0815.ru
0clickemail.com
0wnd.net
0wnd.org
10minutemail.com
20minutemail.com
2prong.com
30minutemail.com
3d-painting.com
@smant
smant / bootstrap.sh
Last active November 28, 2018 10:42
ubuntu frontend developer
# install
# - git
# - python 2.7, pip
# - docker # https://docs.docker.com/install/linux/docker-ce/ubuntu/#install-docker-ce
# - docker-compose # https://docs.docker.com/compose/install/#install-compose
# - awscli # https://aws.amazon.com/ru/cli/
# - node, npm # https://github.com/nodesource/distributions/blob/master/README.md#debinstall
set -e
@smant
smant / aws.sh
Last active December 5, 2017 14:57
aws ecs
#!/bin/sh
if [ "$AWS" != "" ] ; then
if which curl 1>/dev/null; then
AWS_EC2_LOCAL_IPV4=`curl --connect-timeout=1 http://169.254.169.254/latest/meta-data/local-ipv4 2>/dev/null`
else
if which wget 1>/dev/null; then
AWS_EC2_LOCAL_IPV4=`wget -q -O - http://169.254.169.254/latest/meta-data/local-ipv4`
fi
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings")
import subprocess
import json
from gscapi.widgets.models import Widget
def main():
qs = Widget.objects.all()
@smant
smant / django.uwsgi
Created January 22, 2014 14:38
пример ini для uwsgi
[uwsgi]
chdir=/opt/demo/api/
virtualenv=/opt/demo/env/
module=gscapi.wsgi:application
processes=2
master=True
disable-logging=True
reload-on-as=512
[program:gunicorn-graphite]
command=/usr/local/bin/gunicorn_django -u www-data -g www-data -b 127.0.0.1:8080 --log-file=/opt/graphite/storage/log/webapp/gunicorn.log /opt/graphite/webapp/graphite/settings.py
process_name=%(program_name)s
autostart=true
autorestart=true
stopsignal=QUIT
user=www-data
[program:carbon-cache]
command=python /opt/graphite/bin/carbon-cache.py --debug start
@smant
smant / gist:6952357
Created October 12, 2013 17:02
value_if_active - django template tag
@register.simple_tag(takes_context=True)
def value_if_active(context, return_value, view_names):
""" {% value_if_active 'contacts' 'class="active" %}
{% value_if_active 'contacts contacts/about' 'class="active" %}
{% value_if_active 'contacts*' 'class="active" %} - glob syntax
"""
request = context['request']
try:
view_name = resolve(request.path).view_name
for vn in view_names.split():