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
const domains = [ | |
"gmail.com", | |
"yahoo.com", | |
"hotmail.com", | |
"aol.com", | |
"hotmail.co.uk", | |
"hotmail.fr", | |
"msn.com", | |
"yahoo.fr", | |
"wanadoo.fr", |
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 { | |
XPTOService | |
} from '../services' | |
import { loginFailed } from './index.js' | |
const initial = { | |
filtering: { | |
data: [] | |
}, | |
listing: {} |
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/sh | |
# Examples: | |
# ./image64.sh myImage.png | |
# outputs: data:image/png;base64,xxxxx | |
# ./image64.sh myImage.png -img | |
# outputs: <img src="data:image/png;base64,xxxxx"> | |
append="" | |
if [[ "$1" == *.gif ]]; 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
// connect() is a function that injects Redux-related props into your component. | |
// You can inject data and callbacks that change that data by dispatching actions. | |
function connect(mapStateToProps, mapDispatchToProps) { | |
// It lets us inject component as the last step so people can use it as a decorator. | |
// Generally you don't need to worry about it. | |
return function (WrappedComponent) { | |
// It returns a component | |
return class extends React.Component { | |
render() { | |
return ( |
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
function resize (file, maxWidth, maxHeight, fn) { | |
var reader = new FileReader(); | |
reader.readAsDataURL(file); | |
reader.onload = function (event) { | |
var dataUrl = event.target.result; | |
var image = new Image(); | |
image.src = dataUrl; | |
image.onload = function () { |
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
$ python -c 'import random; print "".join([random.choice("abcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*(-_=+)") for i in range(50)])' |
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
;(function ($) { | |
/** | |
* Return an object consisting of properties of 'data' | |
* that match the regex 'pattern'. If trim is not false, | |
* trim the matched 'pattern' from the property name, | |
* and make the first char of the remaining property | |
* name lowercase. | |
*/ | |
function filterData(data, pattern, trim) { | |
var data, |
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
/** | |
* Prevent click events after a touchend. | |
* | |
* Inspired/copy-paste from this article of Google by Ryan Fioravanti | |
* https://developers.google.com/mobile/articles/fast_buttons#ghost | |
* | |
* USAGE: | |
* Prevent the click event for an certain element | |
* ```` | |
* PreventGhostClick(myElement); |
NewerOlder