This file contains hidden or 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 { HttpLink } from 'apollo-link-http' | |
// import { InMemoryCache } from 'apollo-cache-inmemory' | |
import { ApolloLink } from 'apollo-link' | |
import { HttpLink } from 'apollo-link-http' | |
import { InMemoryCache } from 'apollo-cache-inmemory' | |
const GRAPHCMS_API = 'https://api.graphcms.com/simple/v1/myBlog' | |
export default (ctx) => { | |
const httpLink = new HttpLink({ uri: GRAPHCMS_API }) |
This file contains hidden or 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
Add to .gitignore file | |
node_modules | |
Then call: | |
git rm -r --cached node_modules | |
git commit -m "Remove node_modules now that they're ignored!" | |
git push origin master |
This file contains hidden or 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
// Clone the repo | |
git clone --depth=1 git://someserver/somerepo dirformynewrepo | |
// Remove the .git directory | |
rm -rf !$/.git |
This file contains hidden or 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
git rm -r --cached dir1 dir2 |
This file contains hidden or 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
{"lastUpload":"2019-12-17T01:18:41.248Z","extensionVersion":"v3.4.3"} |
This file contains hidden or 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
var getParams = function (url) { | |
var params = {}; | |
var parser = document.createElement('a'); | |
parser.href = url; | |
var query = parser.search.substring(1); | |
var vars = query.split('&'); | |
for (var i = 0; i < vars.length; i++) { | |
var pair = vars[i].split('='); | |
params[pair[0]] = decodeURIComponent(pair[1]); | |
} |
This file contains hidden or 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
/** | |
* Replaces hyphens with spaces. (only hyphens between word chars) | |
*/ | |
function unhyphenate(str){ | |
return str.replace(/(\w)(-)(\w)/g, '$1 $3'); | |
} | |
export const toTitleCase = function (str) { | |
str = str.toLowerCase().split(' '); |
This file contains hidden or 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 slugify from "slugify"; | |
export const slugifyText = str => | |
slugify(str, { replacement: "-", lower: true, remove: /[$*_+~.()'"!\-:@]/g }); | |
export const uniqueArray = originalArray => [...new Set(originalArray)]; | |
export const getPostsFromTag = (posts, tag) => | |
posts.filter(post => post.tags.map(tag => slugifyText(tag)).includes(tag)); |
This file contains hidden or 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
.productAttributeConfigurablePickListSet div.selector.HIDE-ME { | |
display: none !important; | |
} | |
/* | |
Creates space for labels that need to be injected | |
*/ | |
.productOptionViewSelect { | |
margin-top: 40px; |
This file contains hidden or 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
export const uniqueArray = originalArray => [...new Set(originalArray)] | |
export function slugify(textToSlugify) { | |
return textToSlugify | |
.toLowerCase() | |
.replace(/[^\w\s-]/g, '') // remove non-word [a-z0-9_], non-whitespace, non-hyphen characters | |
.replace(/[\s_-]+/g, '-') // swap any length of whitespace, underscore, hyphen characters with a single - | |
.replace(/^-+|-+$/g, '') // remove leading, trailing - | |
} |