Skip to content

Instantly share code, notes, and snippets.

View CharlyJazz's full-sized avatar
🧭
I may be slow to respond.

CharlyJazz

🧭
I may be slow to respond.
View GitHub Profile
rm node_modules -force -recurse
@CharlyJazz
CharlyJazz / withTitle.jsx
Created October 15, 2018 17:39
WIth title with react document title
import React from 'react'
import DocumentTitle from 'react-document-title'
const withTitle = (documentTitle, WrappedComponent) => {
const hocComponent = ({ ...props }) => (
<DocumentTitle title={`${documentTitle.join(' - ')}`}>
<WrappedComponent {...props} />
</DocumentTitle>
)
@CharlyJazz
CharlyJazz / a.json
Last active December 1, 2018 15:58
GET /product/default/_search
{
"query": {
"term": {
"is_active": {
"value": true
}
}
}
}
@CharlyJazz
CharlyJazz / redis-amzn-linux
Created December 9, 2018 23:11 — forked from techgaun/redis-amzn-linux
redis 2.8.x installation on aws ec2 amazon linux
#!/bin/bash
#lost original file so rewrote for future reference, untested
#installs latest 2.8.17
#run as root
yum install -y gcc gcc-c++ make
wget "http://download.redis.io/releases/redis-2.8.17.tar.gz"
tar xvfz redis-2.8.17.tar.gz
rm -f redis-2.8.17.tar.gz
cd redis-2.8.17
make distclean && make
@CharlyJazz
CharlyJazz / install-sqlite.sh
Created December 9, 2018 23:54 — forked from fabrizioc1/install-sqlite.sh
Installing sqlite3 in CentOS for use with ruby-sqlite3
# The YUM package is too old for use with ruby-sqlite3, use the autoconf package from www.sqlite.org
cd /opt
wget http://www.sqlite.org/sqlite-autoconf-3070701.tar.gz
tar xvzf sqlite-autoconf-3070701.tar.gz
ln -s /opt/sqlite-autoconf-3070701 /opt/sqlite3
cd /opt/sqlite3
./configure --prefix=/opt/sqlite3
make
make install
# Shared library will be installed in /usr/local/lib.
sudo iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 3000
https://stackoverflow.com/questions/16573668/best-practices-when-running-node-js-with-port-80-ubuntu-linode
@CharlyJazz
CharlyJazz / h.bash
Created January 8, 2019 14:46
pm2 run package.json script
$ pm2 start npm -- start
const squareDigits = (n) => +n.toString().replace(/(\d)/g, d => d * d);
andresito del telegram
import React from 'react'
import ErrorPage from 'next/error'
export default Component => {
return class WithError extends React.Component {
static async getInitialProps(ctx) {
const props =
(Component.getInitialProps
? await Component.getInitialProps(ctx)
: null) || {}
if (props.statusCode && ctx.res) {
https://www.youtube.com/channel/UCvjgXvBlbQiydffZU7m1_aw
https://www.youtube.com/channel/UC55-mxUj5Nj3niXFReG44OQ
https://www.youtube.com/channel/UCtxCXg-UvSnTKPOzLH4wJaQ
https://www.youtube.com/channel/UClcE-kVhqyiHCcjYwcpfj9w
https://www.youtube.com/channel/UC52hytXteCKmuOzMViTK8_w
https://www.youtube.com/channel/UCLXRGxAzeaLDGaOphqapzmg
https://www.youtube.com/channel/UC-QDfvrRIDB6F0bIO4I4HkQ
https://www.youtube.com/channel/UCBVCi5JbYmfG3q5MEuoWdOw
https://www.youtube.com/channel/UCnUYZLuoy1rq1aVMwx4aTzw
https://www.youtube.com/channel/UCTspylBf8iNobZHgwUD4PXA