Skip to content

Instantly share code, notes, and snippets.

View zamson's full-sized avatar

Andreas sandström zamson

  • Stockholm, Sweden
View GitHub Profile
@kidunot89
kidunot89 / apollo-client.js
Last active July 10, 2020 05:43
useCartMutations - React Hook that use "@apollo-react-hooks", and "uuid" to bundle WooGraphQL cart mutations in a modular tool.
// Node modules
import { ApolloClient } from 'apollo-client';
import { HttpLink } from 'apollo-link-http';
import { InMemoryCache, defaultDataIdFromObject } from 'apollo-cache-inmemory';
import { ApolloLink } from 'apollo-link';
import { onError } from 'apollo-link-error';
import { get, isEmpty } from 'lodash';
// Local imports
import { typeDefs, resolvers } from './schema';
@mrtony
mrtony / react_formik_yup_checkbox_validation.md
Created October 15, 2018 01:31
React formik yup checkbox, radio button validation
import "./formik-demo.css";
import React from "react";
import { render } from "react-dom";
import { Formik, Field } from "formik";
import Yup from "yup";
import classNames from "classnames";

// Input feedback
class LoadMoreButton extends React.Component {
render() {
const { data, path, children, ...otherProps } = this.props;
return (
<button {...otherProps} onClick={this.onClick}>
{children || 'Load more'}
</button>
);
}
Currency Pair: STRAT/BTC
Position size: 10.505761359529567 STRAT (0.15 BTC)
Total allocation: 1.01243906658411473 BTC (2689.474908039569000 STRAT)
Buy Orders (from top to bottom)
@cryppadotta
cryppadotta / 001-Tradingview-Watchlist.md
Last active January 13, 2024 07:16
Tradingview Watchlist Import Files for Crypto Exchanges

Tradingview Watchlist Import Files for Crypto Exchanges

Below you'll find Tradingview import files for Bittrex and Binance BTC-base markets

Ordered by CMC's Market Cap

I use Tradingview and I like to quickly click through all coins on a particular exchange. The files below can be imported into a Tradingview watchlist.

★ ★ ★ If you use these, leave a comment or a star above ★ ★ ★

@wpchannel
wpchannel / mu-yoast-seo-disable-notifications.php
Last active April 16, 2023 08:33
Hide annoying notifications after each upgrade of Yoast SEO plugin and others admin notices
<?php if (!defined('ABSPATH')) die('Restricted Area');
/*
* Plugin Name: Disable Yoast SEO Notifications
* Description: Hide annoying notifications after each upgrade of Yoast SEO plugin and others admin notices.
* Version: 1.1
* Author: Aurélien Denis
* Author URI: https://wpchannel.com/
*/
@pelmered
pelmered / wpfcwc.conf
Created March 27, 2015 08:56
EasyEngine WooCommerce config with FastCGI Cache
#
set $skip_cache 0;
# POST requests and URL with a query string should always go to php
if ($request_method = POST) {
set $skip_cache 1;
}
if ($query_string != "") {
@alisspers
alisspers / mysql-alter-collation-on-all-tables.sql
Created May 21, 2014 13:37
Altering all tables in a database to change their collation can be a tedious task if needed on a large database. This nifty little trick based on a SO answer (http://stackoverflow.com/a/19462205) returns a list of all altercommands for the tables in a database, to make your life a bit easier.
/*
Get a list of all ALTER commands needed to change collation on all tables in the given database
Note: Remember to set your database name on line 7, and change utf8_swedish_ci to the collation of your choice
Props goes to this answer on StackOverflow: http://stackoverflow.com/a/19462205
*/
SELECT CONCAT("ALTER TABLE `", TABLE_NAME,"` CONVERT TO CHARACTER SET utf8 COLLATE utf8_swedish_ci;") AS mySQL
FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_SCHEMA="YOUR_DATABASE_NAME"
AND TABLE_TYPE="BASE TABLE"
@sangeeths
sangeeths / github-to-bitbucket
Created March 10, 2014 15:24
Forking a Github repo to Bitbucket
Go to Bitbucket and create a new repository (its better to have an empty repo)
git clone git@bitbucket.org:abc/myforkedrepo.git
cd myforkedrepo
Now add Github repo as a new remote in Bitbucket called "sync"
git remote add sync git@github.com:def/originalrepo.git
Verify what are the remotes currently being setup for "myforkedrepo". This following command should show "fetch" and "push" for two remotes i.e. "origin" and "sync"
git remote -v
@rosswd
rosswd / multi-git-win.md
Last active February 28, 2024 09:46
Setting up a Github and Bitbucket account on the same computer on Mac OS. Now with a guide for Windows 10.

Setting up github and bitbucket on the same computer (Windows)

Guide for Windows

mix3d asked for some help using this guide with windows so here we go. This was tested with Windows 10. Run all commands in Git Bash once it's installed.

Github will be the main account and bitbucket the secondary.

Git for Windows

  • Download and install Git for Windows
    • In the installer, select everything but decide if you want a desktop icon (2nd step)