This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jobs: | |
build: | |
docker: | |
... | |
- image: docker.elastic.co/elasticsearch/elasticsearch:6.4.2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { generateFetchLocale } from 'lib/utils' | |
import * as React from 'react' | |
import Button from 'templates/html/snippets/Button' | |
import Closing from 'templates/html/snippets/Closing' | |
import Footer from 'templates/html/snippets/Footer' | |
import FullWidthBorder from 'templates/html/snippets/FullWidthBorder' | |
import Greeting from 'templates/html/snippets/Greeting' | |
import Header from 'templates/html/snippets/Header' | |
import Layout from 'templates/html/snippets/Layout' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This file has to be required before rails-ujs | |
// To use it change `data-confirm` of your links to `data-confirm-swal` | |
(function() { | |
const handleConfirm = function(element) { | |
if (!allowAction(this)) { | |
Rails.stopEverything(element) | |
} | |
} | |
const allowAction = element => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
document.addEventListener('rails:attachBindings', element => { | |
Rails.delegate(document, 'a[data-confirm-swal]', 'click', handleConfirm) | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const handleConfirm = link => { | |
// Do your thing | |
} | |
Rails.delegate(document, 'a[data-confirm-swal]', 'click', handleConfirm) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Rails from 'rails-ujs'; | |
const handleConfirm = () => { | |
// Do your thing | |
} | |
// Add event listener before the other Rails event listeners like the one | |
// for `method: :delete` | |
Rails.delegate(document, 'a[data-confirm-swal]', 'click', handleConfirm) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Override the default confirm dialog of Rails | |
Rails.handleConfirm = link => { | |
if (link.data('confirm') === undefined){ | |
return true | |
} | |
showSweetAlertConfirmationDialog(link) | |
return false | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Override the default confirm dialog of Rails | |
$.rails.handleConfirm = link => { | |
if (link.data('confirm') === undefined){ | |
return true | |
} | |
showSweetAlertConfirmationDialog(link) | |
return false | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Analyze asana task export in JS console | |
// Format of a task title has to be "[estimated amount of time] title (Actual time used for the task)" | |
// It prints out the average deviation of the estimated time | |
// Open the export JSON in Chrome and run this script in the browser console | |
if (typeof(x) === 'undefined') { | |
const x = JSON.parse($('pre').innerHTML) | |
} | |
var differences = [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Copy and paste this script into the Javascript console at https://www.vimgolf.com | |
// and you get a tab delimited list of the entries that can be copied and pasted | |
// into a spreadsheet. | |
var resultString = []; | |
$('#content .grid_7 div h5').each(function(i, e) { | |
var $link = $(e).find('a'); | |
var url = 'https://www.vimgolf.com' + $link.attr('href'); | |
var urlParts = url.split('/'); | |
var challengeID = urlParts[urlParts.length - 1]; |
NewerOlder