Skip to content

Instantly share code, notes, and snippets.

@burtyish
burtyish / custom.html
Last active July 29, 2019 06:01
Webflow custom code
<!-- remodal -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/remodal/1.1.0/remodal.min.js"></script>
<!-- remodal - youtube API -->
<script>
var tag = document.createElement("script");
tag.src = "https://www.youtube.com/iframe_api";
var firstScriptTag = document.getElementsByTagName("script")[0];
firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);
// 3. This function creates an <iframe> (and YouTube player)
@burtyish
burtyish / custom variable.js
Last active June 25, 2019 14:05
GTM: override oauth referrals
/*
Based on:
- https://www.simoahava.com/gtm-tips/implement-referral-exclusions-via-gtm/
- https://medium.com/@postman31/dont-let-oauth-fools-your-analytics-88d56523f6b1
- https://www.thyngster.com/tip-maintaining-proper-session-attribution-in-ga-when-using-oauth-providers-with-google-tag-manager/
*/
function() {
/* When the user goes thru oauth, the referrer is FB so the session is restarted
See: https://medium.com/@postman31/dont-let-oauth-fools-your-analytics-88d56523f6b1
@burtyish
burtyish / yishai.git.zsh
Last active June 12, 2018 07:40
Custom zsh configuration. Place these files in ~/.oh-my-zsh/custom/
alias gbD="git branch -D "
alias gcom="git checkout origin/master"
@burtyish
burtyish / no-todos.sh
Last active April 17, 2018 10:48
pre-push git hook, prevents pushing if any new `TODO`s were added
#!/bin/sh
# Place this file in the `.git/hooks` directory
HITS=0
for FILE in `git diff origin/HEAD --name-only`; do
grep 'TODO' $FILE 2>&1 >/dev/null
if [ $? -eq 0 ]; then
echo 'New TODO found in file: ' $FILE
((HITS++))
exit 1
@burtyish
burtyish / intercom.rtl.css
Last active January 3, 2018 13:35
RTL intercom alignment fix
body.rtl #intercom-container .intercom-app.intercom-app-left-aligned [class^=intercom-] {
right: auto;
}
@burtyish
burtyish / Typescript
Last active April 24, 2018 07:41
Webstorm React component file templates
import React from 'react';
interface IProps {
}
export class {$NAME} extends React.Component<IProps, IState> {
public render() {
return (
);
@burtyish
burtyish / readme.md
Last active March 14, 2016 13:57
React & Redux resources
@burtyish
burtyish / page-visibility-service.js
Last active September 19, 2019 20:55
Page Visibility Service for a Redux/Flux app
/* Based on http://www.html5rocks.com/en/tutorials/pagevisibility/intro/ */
class PageVisibilityService {
constructor(store) {
this.store = store;
this.prop = this.getHiddenProp();
this.register();
}
getHiddenProp(){
@burtyish
burtyish / uservoice-trigger.js
Created August 18, 2015 11:40
UserVoice Widget Trigger React Component
import React from 'react';
import _ from 'lodash';
const UserVoiceTrigger = React.createClass({
propTypes: {
id: React.PropTypes.string.isRequired
},
getDefaultProps() {