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
git rev-list --all | ( | |
while read revision; do | |
git grep -F 'overrideNwayTestVariants' $revision | grep -v exclude_filename1.js | grep -v exclude_filename1.js; | |
done; | |
) | |
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
// load in background js | |
const animatedGif = new Image() | |
animatedGif.src = animatedGifSrc | |
animatedGif.onload = () => { | |
this.setState({ mobileImgSrc: animatedGif.src }) | |
} | |
// load via xhr | |
const xhr = new XMLHttpRequest() |
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
// example for "scroll" | |
const simulateEvent = (eventType, e) => { | |
const listeners = window.addEventListener.mock.calls.filter((call) => call[0] === eventType).map((call) => call[1]) | |
listeners.forEach((listener) => listener(e)) | |
} | |
beforeEach(() => { | |
jest.spyOn(window, "addEventListener").mockImplementation(noop) | |
jest.spyOn(window, "removeEventListener").mockImplementation(noop) | |
}) |
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
# height adjust for mobile safari | |
# for when you sometimes need the window height to be the actual visible viewport | |
export default class MyComponent extends React.Component { | |
constructor(props) { | |
super(props) | |
this.state = { | |
height_adjust: 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
https://flaviocopes.com/shell-environment-variables/ |
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
{ | |
"global": { | |
"check_for_updates_on_startup": true, | |
"show_in_menu_bar": true, | |
"show_profile_name_in_menu_bar": false | |
}, | |
"profiles": [ | |
{ | |
"complex_modifications": { | |
"parameters": { |
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
<div id = "root"></div> | |
<ul style = ""> | |
<li><img src="images_400x400/ESP_013368_1885.jpg"></li> | |
<li><img src="images_400x400/ESP_013954_1780.jpg"></li> | |
<li><img src="images_400x400/ESP_014185_1095.jpg"></li> | |
<li><img src="images_400x400/ESP_014351_1995.jpg"></li> |
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
<script id="template" type="x-tmpl-mustache"> | |
<section class="stage"> | |
<figure class="ball" | |
style = "background: url('{{ imgUrl }}') repeat-x;" | |
><span class="shadow"></span></figure> | |
</section> | |
</script> |
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
# equivilant of watch command on mac os | |
while :; do clear; ps 3277; sleep 2; done |
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
""" | |
snippet for twitter bots, follow back all followers, unfollow unfollowers (with exceptions) | |
""" | |
import tweepy | |
from secrets import CONSUMER_KEY, CONSUMER_SECRET, ACCESS_KEY, ACCESS_SECRET | |
auth = tweepy.OAuthHandler(CONSUMER_KEY, CONSUMER_SECRET) | |
auth.set_access_token(ACCESS_KEY, ACCESS_SECRET) | |
api = tweepy.API(auth) | |
NewerOlder