Skip to content

Instantly share code, notes, and snippets.

Avatar

Bradley Priest bradleypriest

View GitHub Profile
@bradleypriest
bradleypriest / expired-hound.js
Created Mar 16, 2017
Remove expired Hound comments from a Github PR
View expired-hound.js
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
View changelog.json
{
"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}}",
View changelogs.json
{
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 Dec 8, 2016
Sentry - Expand Mixpanel events
View sentry.js
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);
View filepicker.css
.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;
View Nested Custom Attributes.md

PUT /variants/12345

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

Minimal

POST /variants/12345/transfer

{ 
  "variant": {
    "new_product_id": "123" // Required
  }
}
View gist:ee3b525e7f51fd3c0beb
{% for item in product_line_items %}
{{item.label}} {{item.quantity}} of a {{item.variant.title}} at {{item.price | money}} each.
{% endfor %}
View public-emails
!gmail.com
.gmail.com
1033edge.com
11mail.com
123.com
123box.net
123india.com
123mail.cl
123qwe.co.uk
150ml.com
View findManyInChunks.js
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;