This file contains hidden or 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
[alias] | |
empty = "!sh -c 'git switch --orphan $0 && git commit --allow-empty -m \"empty commit\" && git rebase --onto master $0 && git push -u origin $0'" |
This file contains hidden or 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 { expect } from 'chai'; | |
import { bool } from 'aws-sdk/clients/signer'; | |
describe('codewars', () => { | |
it('set unique', () => { | |
const arrayDiff = (l, r) => Array.from(new Set(l.concat(r))); | |
const t = arrayDiff([1, 2], [2]); | |
expect(t).to.have.lengthOf(2); |
This file contains hidden or 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
# https://gitlab.com/gitlab-org/gitlab-runner/issues/3021 | |
# TODO: token cannot have an underscore | |
# https://aws.amazon.com/ec2/spot/pricing/ | |
# TODO: calculate base spot pricing | |
concurrent = 10 | |
check_interval = 0 | |
[[runners]] | |
name = "gitlab-aws-autoscaler-<service>" # TODO: modify here |
This file contains hidden or 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
Object.defineProperty(Array.prototype, 'flat', { | |
value: function(res = []) { | |
Object(this).forEach(cursor => { | |
if (Object.prototype.toString.call(cursor) === '[object Array]') { | |
cursor.flat(res); | |
} else { | |
res.push(cursor); | |
} | |
}); |
This file contains hidden or 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 React from 'react'; | |
import { render } from 'react-dom'; | |
import { Provider } from 'react-redux'; | |
import { applyMiddleware, combineReducers, createStore } from 'redux'; | |
import thunk from 'redux-thunk'; | |
import router from './router'; | |
import reducer from 'reducers/default'; | |
window.NAMESPACE.store = createStore( |
This file contains hidden or 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
[user] | |
name = listenrightmeow | |
email = | |
signingkey = | |
[alias] | |
all = !git branch -a | grep | |
br = checkout -b | |
ba = branch --all | |
changelog = !git log $1...$2 --pretty=format:'- %s' --abbrev-commit --no-merges | |
co = checkout |
This file contains hidden or 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 sys | |
LOGGING = { | |
'version': 1, | |
'disable_existing_loggers': False, | |
'formatters': { | |
'standard': { | |
'format': '%(asctime)s [%(levelname)s] %(name)s: %(message)s' | |
} | |
}, |
This file contains hidden or 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
clusterName: us-west-2 | |
externalDNSName: k8.svc.production.tld | |
createRecordSet: true | |
recordSetTTL: 300 | |
hostedZoneId: ... | |
keyName: kube-aws | |
region: us-west-2 | |
kmsKeyArn: ... | |
controllerCount: 2 | |
controller: |
This file contains hidden or 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
<?php | |
function create_responsive_images($id) { | |
$file = get_attached_file($id); | |
$image = wp_get_image_editor($file); | |
if (!is_wp_error($image)) { | |
$dimensions = $image->get_size(); | |
$width = $dimensions['width']; | |
$sizes = array(); | |
$measurements = array(0.14, 0.26, 0.28, 0.35, 0.3875, 0.50, 0.52, 0.70, 0.775); |
This file contains hidden or 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
$(target, this.$el).on('click', function() { | |
var now = new Date(), | |
dtstamp = now.toISOString(), | |
dtend = function() { now.setHours(19,0,0,0); return now; }, | |
dtstart = function() { now.setHours(18,0,0,0); return now; }, | |
meow = 'location', | |
summary = 'summary', | |
icsMSG = 'BEGIN:VCALENDAR\nVERSION:2.0\n' + | |
'PRODID:-//Take Back The Table//NONSGML v1.0//EN\n' + | |
'CALSCALE:GREGORIAN\n' + |
NewerOlder