View machine.js
// Available variables: | |
// - Machine | |
// - interpret | |
// - assign | |
// - send | |
// - sendParent | |
// - spawn | |
// - raise | |
// - actions |
View import-container.js
import Container from 'react-bootstrap/Container' | |
import Row from 'react-bootstrap/Row' | |
import Col from 'react-bootstrap/Col' |
View media-query.scss
@include media-breakpoint-up(md) { | |
} |
View coloors-co-shades-in-console.js
let allColorData = []; | |
document.querySelectorAll('#colors .color').forEach(colorNode => { | |
const colorData = { | |
name: colorNode.querySelector('.color-info-name').textContent, | |
hex: colorNode.querySelector('.hex input').value, | |
shades: [] | |
} | |
allColorData.push(colorData); | |
}) |
View small-component.js
// eslint-disable-next-line react/prop-types | |
const AvailableAddress = ({ address }) => { | |
return ( | |
<AddressStatus address={address} status="isAvailable" /> | |
) | |
}; |
View react-jest-testing.js
// simple component test | |
import React from 'react'; | |
import { shallow } from 'enzyme'; | |
import Button from './Button'; | |
function setupComponent (props) { | |
return shallow(<Button {...props} />); | |
} | |
it('should render the button', () => { |
View Copy Jira Task-ID and Tasktitle.js
// full version | |
(function () { | |
var node = document.createElement('textarea') | |
var selection = document.getSelection() | |
let issue = ''; | |
if(document.querySelector('#issuekey-val')) { | |
issue = document.querySelector('#issuekey-val').textContent; | |
} |
View close applications in alfred
on alfred_script(q) | |
tell application "Sequel Pro" to quit | |
tell application "Dash" to quit | |
tell application "Tower" to quit | |
tell application "iTerm" to quit | |
tell application "Sublime Text 2" to quit | |
end alfred_script |
View gist:2283945b5f5d29a5e98b74114a0829bc
tell application "Mail" | |
set theSubject to "Subject" -- the subject | |
set theContent to "Content" -- the content | |
set theAddress to "xxx@163.com" -- the receiver | |
set theSignatureName to "signature_name"-- the signature name | |
set theAttachmentFile to "Macintosh HD:Users:moligaloo:Downloads:attachment.pdf" -- the attachment path | |
set msg to make new outgoing message with properties {subject: theSubject, content: theContent, visible:true} |
View angular-window-resize-event.js
/** | |
* Window resize event handling | |
*/ | |
angular.element($window).on('resize', function () { | |
console.log($window.innerWidth); | |
}); |
NewerOlder