Skip to content

Instantly share code, notes, and snippets.

@altescape
altescape / code-input-method.markdown
Created January 15, 2024 19:20
Code input method
@altescape
altescape / Cloudflare Web Analytics GraphQL query
Last active May 31, 2023 10:00
An example query of Cloudflare Web Analytics using GraphQL
# rumPageloadEventsAdaptiveGroups: for visits and pageloads
# rumPerformanceEventsAdaptiveGroups: for performance metrics
# rumWebVitalsEventsAdaptiveGroups: for Web Vitals metrics
query {
viewer {
accounts(filter: { accountTag: "abc123" }) {
rumPageloadEventsAdaptiveGroups(
filter: { date_in: ["2023-05-23", "2023-05-24"], siteTag: "def456" }
limit: 10
@altescape
altescape / keybindings.json
Last active May 17, 2022 14:14
VSCode camel case navigation key bindings
[
{
"key": "ctrl+right",
"command": "cursorWordPartRight",
"when": "textInputFocus"
},
{
"key": "ctrl+shift+right",
"command": "cursorWordPartRightSelect",
"when": "textInputFocus"
@altescape
altescape / canvas-glitch-effect.markdown
Created February 15, 2019 17:04
Canvas. Glitch effect
@altescape
altescape / README.md
Created October 10, 2018 10:21
Find and replace something in a database table using SED

Take a backup

mysqldump -u USERNAME -p --databases DATABASENAME > dump-all.sql

Dump the table

mysqldump -u USERNAME -p DATABASENAME TABLENAME > dump.sql

Use sed to find and replace text

shop.treccani.it http://shop.treccani.it/
unique-vintage.com http://www.unique-vintage.com/
jomso.com http://www.jomso.com/
industrykart.com http://www.industrykart.com/
store.circuitstoday.com http://store.circuitstoday.com/
educationmalaysia.gov.my http://educationmalaysia.gov.my/
vexrobotics.com http://www.vexrobotics.com/
globalim.linuxpl.info http://www.globalim.linuxpl.info/
store.thetech.org http://store.thetech.org/
fatquartershop.com http://www.fatquartershop.com/
//////
//
// ES6 Object.assign ...or... The correct way to set settings, from defaults and options.
//
let defaults = {
a: 1,
b: 2,
c: 3
};
@altescape
altescape / Flipping-signup-form.markdown
Created April 23, 2014 13:19
A Pen by Michael Watts.