Skip to content

Instantly share code, notes, and snippets.

Avatar

Alec Rust AlecRust

View GitHub Profile
@AlecRust
AlecRust / functions.php
Last active Aug 21, 2021
Add latest WooCommerce order product name as Mailchimp tag
View functions.php
/**
* Add customer's last order product name as Mailchimp member tag on sync
*/
function product_mailchimp_tag($tags, $email)
{
$new_tags = [];
$query = new WC_Order_Query();
$query->set('customer', $email);
$customer_orders = $query->get_orders();
View vscode user settings
// Place your settings in this file to overwrite the default settings
{
"window.title": "${activeEditorMedium}${separator}${rootName}",
"editor.fontSize": 17,
"editor.fontFamily": "'Fira Code', 'Source Code Pro', Menlo, Monaco, 'Courier New', monospace",
"editor.tabSize": 2,
"editor.fontLigatures": true,
"editor.snippetSuggestions": "top",
"editor.rulers": [80,120],
"explorer.autoReveal": false,
View editField.js
const getValue = require('get-value')
const React = require('react')
const hyperx = require('hyperx')
const hx = hyperx(React.createElement)
module.exports = class EditField extends React.Component {
render () {
const path = this.props.path
const label = this.props.label
const id = this.props.id
@AlecRust
AlecRust / links.md
Created Apr 22, 2017
GitHub Release Notification Options
View dabblet.css
/*
Ratings Stars
(with as little code as possible)
*/
.rating {
unicode-bidi: bidi-override;
direction: rtl;
text-align: center;
}
.rating > span {
@AlecRust
AlecRust / gulpfile.js
Created Mar 12, 2017
Example gulp automated release workflow
View gulpfile.js
var gulp = require('gulp');
var runSequence = require('run-sequence');
var conventionalChangelog = require('gulp-conventional-changelog');
var conventionalGithubReleaser = require('conventional-github-releaser');
var bump = require('gulp-bump');
var gutil = require('gulp-util');
var git = require('gulp-git');
var fs = require('fs');
gulp.task('changelog', function () {
View keybase.md

Keybase proof

I hereby claim:

  • I am AlecRust on github.
  • I am alecrust (https://keybase.io/alecrust) on keybase.
  • I have a public key whose fingerprint is 03A2 F5EB DE68 0297 469B A142 5363 9C2A BD44 9581

To claim this, I am signing this object:

@AlecRust
AlecRust / jenkins_build.js
Created Apr 14, 2016
Jenkins Remote Build Script
View jenkins_build.js
var curl = require('curlrequest');
var jenkinsUrl = 'https://jenkins-co32experience.rhcloud.com/job/production-build/';
var options = {
url: jenkinsUrl + 'build',
method: 'POST',
data: {
token: process.env.BUILD_AUTH_TOKEN
},
@AlecRust
AlecRust / gist:4bc7b92cc6dff08193f4
Created Apr 23, 2015
[WordPress] Request assets from live server if fails locally
View gist:4bc7b92cc6dff08193f4
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /wp-content/uploads/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*) http://yourlivesite.com/wp-content/uploads/$1 [L,P]
</IfModule>
View gist:4b82950d389a7311f208
$ g log
commit 56b11096640a8f936810f0404aacf79826e5f60d
Merge: 1ca2b41 852b1eb
Author: Andrew Vos <andrew.vos@gmail.com>
Date: Tue Oct 28 09:39:49 2014 +0000
Merge pull request #880 from shopa/ruby2.1.4
Upgrade to ruby 2.1.4