Skip to content

Instantly share code, notes, and snippets.

View bradleypriest's full-sized avatar

Bradley Priest bradleypriest

View GitHub Profile
@bradleypriest
bradleypriest / expired-hound.js
Created March 16, 2017 05:07
Remove expired Hound comments from a Github PR
window.$ = require('jquery');
window.oldconfirm = window.confirm;
window.confirm = () => true
$('.delete-button:hidden').each((idx, item) => {
if ($(item).parents('.edit-comment-hide').find('strong a[href="/houndci-bot"]').length) {
$(item).click();
}
});
window.confirm = window.oldconfirm;
delete window.oldconfirm
{
"addressable": "https://github.com/sporkmonger/addressable/compare/addressable-{{from}}...addressable-{{to}}",
"algoliasearch-client-ruby": "https://github.com/algolia/algoliasearch-client-ruby/compare/{{from}}...{{to}}",
"autoprefixer-rails": "https://github.com/ai/autoprefixer-rails/compare/{{from}}...{{to}}",
"builder": "https://github.com/tenderlove/builder/compare/v{{from}}...v{{to}}",
"bullet": "https://github.com/flyerhzm/bullet/blob/master/CHANGELOG.md#{{from}}...{{to}}",
"capybara": "https://github.com/teamcapybara/capybara/compare/{{from}}...{{to}}",
"coffee-script-source": "http://coffeescript.org/#{{from}}...{{to}}",
"config": "https://github.com/railsconfig/config/compare/{{from}}...{{to}}",
"faraday": "https://github.com/lostisland/faraday/releases#{{from}}...{{to}}",
{
addressable: "https://github.com/sporkmonger/addressable/compare/addressable-{{from}}...addressable-{{to}}",
autoprefixer-rails: "https://github.com/ai/autoprefixer-rails/compare/{{from}}...{{to}}",
builder: "https://github.com/tenderlove/builder/compare/v{{from}}...v{{to}}",
bullet: "https://github.com/flyerhzm/bullet/blob/master/CHANGELOG.md#{{from}}...{{to}}",
capybara: "https://github.com/teamcapybara/capybara/compare/{{from}}...{{to}}",
coffee-script-source: "http://coffeescript.org/#{{to}}",
faraday: "https://github.com/lostisland/faraday/releases#{{from}}...{{to}}",
font-awesome-sass: "https://github.com/FortAwesome/font-awesome-sass/compare/{{from}}...{{to}}",
hashdiff: "https://github.com/liufengyun/hashdiff/blob/master/changelog.md#{{from}}...{{to}}",
@bradleypriest
bradleypriest / sentry.js
Last active December 8, 2016 14:59
Sentry - Expand Mixpanel events
var mixpanelHandler = function(event) {
var strong = $(event.target).siblings('strong')[0];
if (strong.innerText.trim() === 'GET') {
var data = atob(unescape(event.target.href.match(/\?data\=(.+)\&ip/)[1]))
event.target.setAttribute('title', data);
strong.innerText = `MIXPANEL - ${JSON.parse(data).event} `;
}
}
$(document).on('mouseover', 'a[href*=mixpanel]', mixpanelHandler);
.fp__action-bar, .fp__header, .content__header, .mobile-navigation {
display: none;
}
.fp__drag-and-drop {
position: inherit;
top: 0;
left: 0;
right: 0;
bottom: 0;

PUT /variants/12345

{ 
  "variant": {
    "attributes": [
      {
        "id":           "1234567", // Update attribute value
        "name":         "Moxy"
 },

Minimal

POST /variants/12345/transfer

{ 
  "variant": {
    "new_product_id": "123" // Required
  }
}
{% for item in product_line_items %}
{{item.label}} {{item.quantity}} of a {{item.variant.title}} at {{item.price | money}} each.
{% endfor %}
!gmail.com
.gmail.com
1033edge.com
11mail.com
123.com
123box.net
123india.com
123mail.cl
123qwe.co.uk
150ml.com
@bradleypriest
bradleypriest / findManyInChunks.js
Last active August 29, 2015 13:57
FindManyInChunks
function flatten(arrays) {
return Array.prototype.concat.apply([], arrays)
}
findMany: function(store, type, ids) {
var chunkSize = 200;
if (ids.length > chunkSize) {
var promises = [],
index = 0,
currentIds;