I hereby claim:
- I am chr33s on github.
- I am chr33s (https://keybase.io/chr33s) on keybase.
- I have a public key ASAj_bkYKn5P4If5qHUQDUwRnKM8_w35E6AvxrCpMEoAwgo
To claim this, I am signing this object:
| const { parse } = require('graphql/language'); | |
| /** | |
| * Calculates the cost of a GraphQL query based on its structure. | |
| * | |
| * @param {string} query - The GraphQL query to calculate the cost for. | |
| * @param {boolean} [debug=false] - If true, additional debug information will be logged. | |
| * @return {number} The total cost of the query. | |
| */ | |
| function calculateQueryCost(query, debug = true) { |
| [ | |
| {"name": "dev", "llms_txt": "https://shopify.dev/llms.txt"}, | |
| {"name": "api", "llms_txt": "https://shopify.dev/docs/api.txt"}, | |
| {"name": "api-admin", "llms_txt": "https://shopify.dev/docs/api/admin-graphql.txt"}, | |
| {"name": "api-customer", "llms_txt": "https://shopify.dev/docs/api/customer.txt"}, | |
| {"name": "api-storefront", "llms_txt": "https://shopify.dev/docs/api/storefront.txt"}, | |
| {"name": "app-bridge", "llms_txt": "https://shopify.dev/docs/api/app-bridge.txt"}, | |
| {"name": "cli", "llms_txt": "https://shopify.dev/docs/api/shopify-cli.txt"}, | |
| {"name": "polaris", "llms_txt": "https://shopify.dev/docs/beta/next-gen-dev-platform/polaris.txt"} | |
| ] |
| #!/usr/bin/env bash -e | |
| PACKAGE_VERSION=$(cat package.json | grep version | head -1 | awk -F: '{ print $2 }' | sed 's/[\",]//g' | tr -d '[[:space:]]') | |
| function android() { | |
| MANIFEST_FILE="./android/app/build.gradle" | |
| VERSION_NAME=$(grep versionName ${MANIFEST_FILE} | head -1 | sed 's/versionName //' | tr -d '[:space:]') | |
| VERSION_CODE=$(grep versionCode ${MANIFEST_FILE} | head -1 | sed 's/versionCode //' | tr -d '[:space:]') |
I hereby claim:
To claim this, I am signing this object:
| 'use strict' | |
| const {contentType} = require('mime-types') | |
| const {createServer} = require('http') | |
| const {extname} = require('path') | |
| const {readFile} = require('fs') | |
| const server = createServer(function (req, res) { | |
| if (req.method === 'HEAD' || req.method === 'GET') { | |
| const file = req.url.substr(1) || 'index.html' |
| su | |
| apt-get install sudo | |
| adduser chr33s sudo | |
| exit | |
| sudo vi /etc/apt/sources.list | |
| >>> | |
| deb http://ftp.us.debian.org/debian/ jessie main contrib non-free | |
| deb-src http://ftp.us.debian.org/debian/ jessie main contrib non-free | |
| #!/bin/bash | |
| # /etc/network/if-pre-up.d/iptables | |
| iptables-restore < /etc/iptables/rules.v4 | |
| ip6tables-restore < /etc/iptables/rules.v6 |
| My thoughts on writing tiny reusable modules that each do just one | |
| thing. These notes were adapted from an email I recently sent. | |
| *** | |
| If some component is reusable enough to be a module then the | |
| maintenance gains are really worth the overhead of making a new | |
| project with separate tests and docs. Splitting out a reusable | |
| component might take 5 or 10 minutes to set up all the package | |
| overhead but it's much easier to test and document a piece that is |
| char *x; // x: a pointer to char | |
| char x[3]; // x: an array[3] of char | |
| char x(); // x: a function() returning char | |
| char *x[3]; // x: an array[3] of pointer to char | |
| char (*x)[3]; // x: a pointer to array[3] of char | |
| char **x; // x: a pointer to pointer to char | |
| char *x(); // x: a function() returning pointer to char | |
| char *x()[3]; // x: a function() returning array[3] of pointer to char | |
| char (*x[])(); // x: an array[] of pointer to function() returning char | |
| char (*x())(); // x: a function() returning pointer to function() returning char |