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 | |
log stream --predicate 'subsystem == "com.apple.UVCExtension" and composedMessage contains "Post PowerLog"' | while read line; do | |
if echo "$line" | grep -q "= On"; then | |
echo "Camera has been activated." | |
fi | |
# If we catch a camera stop event, turn the light off. | |
if echo "$line" | grep -q "= Off"; then |
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 { | |
endOfMonth, | |
getDay, | |
getDaysInMonth, | |
getWeeksInMonth, | |
startOfMonth, | |
} from 'date-fns'; | |
import takeRight from 'lodash/takeRight'; |
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 { mount } from 'enzyme'; | |
import React from 'react'; | |
import { mockAllIsIntersecting } from 'react-intersection-observer/test-utils'; | |
import WithInfiniteScrolling from './with-infinite-scrolling'; | |
describe('WithInfiniteScrolling', () => { | |
afterEach(() => { | |
jest.clearAllMocks(); | |
}); |
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 React, { useEffect, useState } from 'react'; | |
import { useInView } from 'react-intersection-observer'; | |
const WithInfiniteScrolling = ({ | |
children, | |
hasMultiplePages, | |
loading, | |
loadMoreFunction, | |
requireButtonClick = true | |
}) => { |
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 { withEvents } from 'react-compose-events'; | |
import { compose, withHandlers, withState } from 'recompose'; | |
import { debounce } from './utils'; | |
const LOAD_DISTANCE_FROM_PAGE_BOTTOM = 500; | |
const LOAD_MORE_DEBOUNCE_TIME = 100; | |
const withInfiniteScrolling = (loadMoreFunctionName, startsInfiniteEnabled = false) => compose( | |
withState('infiniteEnabled', 'setInfiniteEnabled', startsInfiniteEnabled), |
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
root = this | |
module = window.Sorta ||= {} | |
$ = jQuery | |
root.Sorta = do ( module, $ ) -> | |
self = module.lists = module.lists || {} | |
self.index = -> | |
Sorta.timeago.callTimeAgo() |
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
// app/controllers/resource/index.js | |
import Ember from 'ember'; | |
// The resource in the file path here is just whatever you are searching. In this app, it's emoji | |
// but I wanted to standardize a bit. Here we are just defining the search query as a query param on | |
// line 9 and then, when the search action is triggered by the form we set the query param on the | |
// current route. | |
export default Ember.Controller.extend({ |
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
class EmojiSearcherTest < ActiveSupport::TestCase | |
let(:collection) { create(:collection) } | |
let(:user) { create(:user) } | |
describe '#search' do | |
before { populate_emoji_list } | |
describe 'when a query argument is sent' do | |
let(:params) do | |
{ |
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 Ember from 'ember'; | |
function authorizationHeader() { | |
// I guess I need to inject service:session here and pull the data from it? | |
// how do? | |
} | |
export default Ember.Component.extend(Droplet, { | |
// options: { | |
// requestHeaders: { |
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
curl 'http://127.0.0.1:3000/emojis/' -H 'Origin: http://localhost:4200' -H 'Accept-Encoding: gzip, deflate' -H 'Accept-Language: en-US,en;q=0.8' -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.86 Safari/537.36' -H 'X-File-Size: 101849' -H 'Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7ZQJvvFCg4Yp6dIO' -H 'Accept: */*' -H 'Referer: http://localhost:4200/emojis/new' -H 'Connection: keep-alive' --data-binary $'------WebKitFormBoundary7ZQJvvFCg4Yp6dIO\r\nContent-Disposition: form-data; name="file"; filename="Batman.jpg"\r\nContent-Type: image/jpeg\r\n\r\n\r\n------WebKitFormBoundary7ZQJvvFCg4Yp6dIO\r\nContent-Disposition: form-data; name="file"; filename="wonder_woman.jpg"\r\nContent-Type: image/gif\r\n\r\n\r\n------WebKitFormBoundary7ZQJvvFCg4Yp6dIO\r\nContent-Disposition: form-data; name="file"; filename="superman.jpg"\r\nContent-Type: image/jpeg\r\n\r\n\r\n------WebKitFormBoundary7ZQJvvFCg4Yp6dIO--\r\n' --compressed |
NewerOlder