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
/* | |
Python and Node don't stringify JSON object the same way. | |
Python adds some spaces after `:` and `,`, causing some trouble if | |
you try to compute the same hashes across languages. | |
Here is a Node function turning a Node generated JSON string into | |
its Python equivalent. | |
*/ | |
export const pythonizeJsonDump = (jsonDump) => | |
jsonDump.replace(/(?!\B"[^"]*)(:|,)(?![^"]*"\B)/g, '$1 '); |
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
aws logs start-query \ | |
--profile [PROFILE] \ | |
--log-group-name [GROUP_NAME] \ | |
--start-time `date --date="-30 minutes" "+%s"` \ | |
--end-time `date "+%s"` \ | |
--query-string 'fields @message | limit 50' \ | |
| jq '.queryId' \ | |
| xargs -I{} aws --profile [PROFILE] logs get-query-results --query-id {} \ | |
| jq '.results | .[][0].value' |
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 COLUMN_NAME = "Deployed to Prod" | |
var column = [...document.querySelectorAll(".BoardBody-column")].filter( | |
column => | |
column.querySelector('.BoardColumnHeader-name') && | |
column.querySelector('.BoardColumnHeader-name').textContent == COLUMN_NAME | |
)[0] | |
Array.from(column.querySelectorAll(".BoardCard")).map(card => { | |
card.querySelector(".BoardCard-dropdownButton").click() |
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
{ | |
"Create new functional component": { | |
"prefix": "_compo", | |
"body": [ | |
"import React from 'react';", | |
"import PropTypes from 'prop-types';", | |
"", | |
"export const $1 = ({$2}) => (", | |
" $3", | |
");", |
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
# config/php/Dockerfile | |
FROM php:7.0-fpm | |
RUN apt-get update | |
RUN apt-get install -y zlib1g-dev && docker-php-ext-install -j$(nproc) zip | |
RUN \ | |
apt-get install -y libpng-dev libjpeg62-turbo-dev libfreetype6-dev && \ | |
docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ && \ | |
docker-php-ext-install -j$(nproc) gd |
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
driver.manage().logs() | |
.get('browser') | |
.then(v => v && v.length && console.log(v)); |
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 typeFinder = type => function* (params = {}, ref = 'master') { | |
const search = function* (searchParams) { | |
const Api = yield initApi; | |
const reference = ref === 'master' ? Api.master() : ref; | |
const preparedForm = Api.form('everything') | |
.ref(reference) | |
.pageSize(200); | |
const predicates = []; |
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
// couvent.js - MIT license | |
Array.prototype.slice.call(document.querySelectorAll('*')).forEach(function (el) { | |
el.style.display = 'none'; | |
}); |
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
#!/bin/bash | |
# @see http://www.jonathan-petitcolas.com/2015/09/21/dump-docker-ized-database-to-amazon-s3.html | |
# Configuration | |
FILENAME="awesomeproject-`date +%Y-%m-%d-%H:%M:%S`.sql" | |
CONTAINER_NAME="awesomeproject_pgsql" | |
DUMPS_FOLDER="/home/awesomeproject/dumps" | |
BUCKET_NAME="awesomeproject-private" |
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 View from "./folder/View"; | |
class Application { | |
constructor() { | |
this.view = new View("I'm a view!"); | |
} | |
sayHello() { | |
console.log("Hello"); | |
} |
NewerOlder