Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View zackify's full-sized avatar
🤠
coding like crazy

Zach Silveira zackify

🤠
coding like crazy
View GitHub Profile
import { useDispatch } from 'react-redux'
import someAction from 'actions/someAction'
export const useSomeAction = () => {
let {setToast} = useJessesContext()
const dispatch = useDispatch()
return ({message, someOtherActionDataIneed}) => {
dispatch(
someAction({setToast, message, someOtherActionDataIneed})
if (typeof window === 'undefined') {
global.window = new Proxy(
{},
{
get: (_, key) => {
// may need to add new stuff here to account for other method types
return () => global.window;
},
set: target => console.log(target),
}
return (
<div>
<Header />
<Products />
<AddToCart />
<Footer />
</div>
)
@zackify
zackify / Test.js
Created May 10, 2020 01:30
Example loading module vs no module
(function(d) {
var script = d.createElement("script");
script.type = "text/javascript";
script.text =
'import("https://passwordless.app/account/module/integrated.js");window.supportsDynamicImport = true;';
d.getElementsByTagName("head")[0].appendChild(script);
var script2 = d.createElement("script");
script2.type = "text/javascript";
//map and use Form over and over, add a button to add another field to state. All up to you
//Form doesn't render a form element, this way it works in rn and web, and wherever else.
// you can wrap all of them in one if you want.
const App = () => {
let [values, setValues] = React.useState([{name: 'test'}])
return values.map((value, index) => (
<Form
values={values}
# set the version from an env variable in ios
/usr/libexec/Plistbuddy -c "Set CFBundleShortVersionString $BUILD_NUMBER" "ios/cnnrnv2/Info.plist"
#in android, app/build.gradle
# versionName = System.env.BUILD_NUMBER
@zackify
zackify / gist:acf19f6ca0f8be13fb90
Last active January 14, 2020 15:06
Visually see react elements
setInterval(function() {
Array.prototype.slice.call(document.querySelectorAll('[data-reactid]'))
.forEach(function(element) {
element.style.background = 'rgba(255,0,0,0.1)';
})
}, 500)
@zackify
zackify / docker-compose.yml
Created April 15, 2018 18:17
Quickstart gutenblock (docker-compose up and it will sync blocks folder)
version: '3.3'
services:
db:
image: mysql:latest
volumes:
- dbdata:/var/lib/mysql
restart: always
ports:
- "3306:3306"

Keybase proof

I hereby claim:

  • I am zackify on github.
  • I am zackify (https://keybase.io/zackify) on keybase.
  • I have a public key whose fingerprint is 03B5 3C3F A415 039C 2749 BD5F F1B3 BDD4 B320 A804

To claim this, I am signing this object:

@zackify
zackify / create-cert.md
Last active October 14, 2019 20:50
Create cert for webpack in one command, mac
"create-cert": "bash -c \"openssl req -new -newkey rsa:2048 -days 365 -nodes -x509 -keyout config/server.key -out config/server.crt -subj \"/C=US/ST=Nevada/L=test/O=test/OU=Software/CN=localhost\" -extensions san -config <(echo '[req]'; echo 'distinguished_name=req'; echo '[san]'; echo 'subjectAltName=DNS:localhost,IP:127.0.0.1') && sudo security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain config/server.crt\"",