Skip to content

Instantly share code, notes, and snippets.

View TimFletcher's full-sized avatar

Tim Fletcher TimFletcher

View GitHub Profile
{
"kutoku-woocommerce/kutoku.php": {
"name": "Kutoku for WooCommerce",
"version": "2.0.0",
"package": "https://storage.googleapis.com/kutoku-plugins/wordpress/kutoku-woocommerce-2.0.0.zip",
"homepage": "https://kutoku.com"
}
}
// Requirements: You need to have the heddels snippet installed on every page so that the `tap` function exists
// NOTE: This is untested code!!!
// Bind an event handler for a successful Gravity forms submission
// https://www.gravityhelp.com/documentation/article/gform_confirmation_loaded/
jQuery(document).bind('gform_confirmation_loaded', function(event, formId){
// If you have any forms you DO NOT want this to run for, exclude them here

Old

<script type="text/javascript" id="flow_elated-custom-js">(function($) {<!-- Begin Heddels Network --->
<script type="text/javascript">
  (function(w, d) {
  var loader = function() {
    var s = d.createElement('script'),
        t = d.getElementsByTagName('script')[0];
    s.src = '//heddels-network.s3.amazonaws.com/6a9db1500c.js'; s.async = true; s.type = 'text/javascript';
@TimFletcher
TimFletcher / client.js
Created December 19, 2016 15:14
meteor sentry package
/* global Raven, Meteor */
/* eslint-disable no-console */
// If you don't configure the Sentry client (i.e. don't set a DSN) it won't send data.
if (Meteor.isClient && Meteor.settings.public.sentry.dsn) {
console.log('Initializing Sentry...');
Raven.config(
Meteor.settings.public.sentry.dsn, {
serverName: Meteor.settings.public.hostUrl,
@TimFletcher
TimFletcher / regex_ejson.js
Created December 6, 2016 16:17
Code to add a Regex type to Meteor's EJSON
import { EJSON } from 'meteor/ejson';
function getOptions(self) {
const opts = [];
if (self.global) opts.push('g');
if (self.ignoreCase) opts.push('i');
if (self.multiline) opts.push('m');
return opts.join('');
}
// Chimp globals
/* globals browser assert server client */
// Meteor globals
/* globals Meteor, Package, Accounts */
export default {
getUrl(path) {
const baseUrl = 'http://localhost:3100/';
@TimFletcher
TimFletcher / fixtures.js
Last active August 19, 2016 20:16
Chimp login fixtures problem
export default {
users: {
create() {
server.execute(() => {
const email = '[email protected]';
const password = 'jkjkjkjk';
let userId;
try {
const user = Meteor.users.findOne({ emails: { $elemMatch: { address: email } } });
Traceback (most recent call last):
File "/home/deploy/.pyenv/versions/fj-2.7.9/bin/gunicorn_django", line 11, in <module>
sys.exit(run())
File "/home/deploy/.pyenv/versions/2.7.9/envs/fj-2.7.9/lib/python2.7/site-packages/gunicorn/app/djangoapp.py", line 143, in run
DjangoApplication("%(prog)s [OPTIONS] [SETTINGS_PATH]").run()
File "/home/deploy/.pyenv/versions/2.7.9/envs/fj-2.7.9/lib/python2.7/site-packages/gunicorn/app/base.py", line 144, in run
Arbiter(self).run()
File "/home/deploy/.pyenv/versions/2.7.9/envs/fj-2.7.9/lib/python2.7/site-packages/gunicorn/arbiter.py", line 59, in __init__
self.setup(app)
File "/home/deploy/.pyenv/versions/2.7.9/envs/fj-2.7.9/lib/python2.7/site-packages/gunicorn/arbiter.py", line 111, in setup
(fj-2.7.9) root@fotojournal /home/deploy: ps aux | grep gunicorn
www-data 7711 0.8 1.0 63140 44372 ? Sl 10:26 3:15 /home/deploy/.pyenv/versions/2.7.9/envs/fj-2.7.9/bin/python2.7 /home/deploy/.pyenv/versions/fj-2.7.9/bin/gunicorn_django --debug --log-level debug -c /www/fotojournal/fj/fj/conf/gunicorn/public.unicorn /www/fotojournal/fj/fj/conf/public_site_settings.py
www-data 7712 0.7 1.0 62320 44160 ? Sl 10:26 2:50 /home/deploy/.pyenv/versions/2.7.9/envs/fj-2.7.9/bin/python2.7 /home/deploy/.pyenv/versions/fj-2.7.9/bin/gunicorn_django --debug --log-level debug -c /www/fotojournal/fj/fj/conf/gunicorn/public.unicorn /www/fotojournal/fj/fj/conf/public_site_settings.py
www-data 7713 0.9 1.0 63308 44384 ? Sl 10:26 3:23 /home/deploy/.pyenv/versions/2.7.9/envs/fj-2.7.9/bin/python2.7 /home/deploy/.pyenv/versions/fj-2.7.9/bin/gunicorn_django --debug --log-level debug -c /www/fotojournal/fj/fj/conf/gunicorn/public.unicorn /www/fotojournal/fj/fj/conf/public_site_settings.py
ww
unicorn.errors.HaltServer: <HaltServer 'Worker failed to boot.' 3>
2016-07-01 08:25:26 [15003] [DEBUG] Current configuration:
2016-07-01 08:25:26 [15003] [DEBUG] proxy_protocol: False
2016-07-01 08:25:26 [15003] [DEBUG] worker_connections: 1000
2016-07-01 08:25:26 [15003] [DEBUG] post_fork: <function post_fork at 0xb6bca33c>
2016-07-01 08:25:26 [15003] [DEBUG] pythonpath: /www/fotojournal/fj/fj
2016-07-01 08:25:26 [15003] [DEBUG] enable_stdio_inheritance: False
2016-07-01 08:25:26 [15003] [DEBUG] worker_class: sync
2016-07-01 08:25:26 [15003] [DEBUG] accesslog: None
2016-07-01 08:25:26 [15003] [DEBUG] syslog_facility: user