Skip to content

Instantly share code, notes, and snippets.

// Open the article and run this into your developer console
(function() {
// --- 1. STYLING ---
const pdfStyles = `
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
line-height: 1.6;
color: #111;
max-width: 800px;
margin: 0 auto;
@andredtr
andredtr / gist:f372177a8fdea60e72937f7ad10f429d
Created January 20, 2024 14:08
Commit & push with cmd+enter
[
{ "key": "cmd+enter", "command": "workbench.action.terminal.sendSequence","args": { "text": "git add .\u000Dgit commit -m \"x\"\u000Dgit push\u000D"},"when": "editorTextFocus"}
]
https://twitter.com/levelsio/status/1743014947263479894
#!/bin/bash
# usefull when importing notes from Notion.
# Update the creation date of each .md file
for file in *.md; do
created=$(grep "Created" "$file") # created="Created: January 20, 2020 8:16 PM"
# extract the date from the string
date=${created#*: } # date="January 20, 2020 8:16 PM"
# convert the date to a format that touch can understand
window.onbeforeunload = function(){
debugger;
return 'Are you sure you want to leave?';
};
do shell script "curl --location --request POST 'https://api.pushover.net/1/messages.json' --header 'Content-Type: application/json' --data '{\"token\": \" YOUR TOKEN HERE \", \"user\":\" YOUR USER HERE\", \"title\":\"Break ended\", \"message\":\"Time to get back at work\" }'"
var params = {
TableName: 'tableName',
KeySchema: [ // The type of of schema. Must start with a HASH type, with an optional second RANGE.
{ // Required HASH type attribute
AttributeName: 'id',
KeyType: 'HASH',
}
],
AttributeDefinitions: [ // The names and types of all primary and index key attributes only
{
{
"query": {
"bool": {
"must": [
{
"match": {
"name": "andre"
}
},
{
FORMAT: 1A
HOST: http://polls.apiblueprint.org/
# André Dutra
Polls is a simple API allowing consumers to view polls and vote in them.
## Questions Collection [/questions]
### List All Questions [GET]
@andredtr
andredtr / javascript30-day3.html
Created September 23, 2018 14:08
Exemplo Criando e Mudando Variaveis no CSS com JS
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Scoped CSS Variables and JS</title>
</head>
<body>
<h2>Update CSS Variables with <span class='hl'>JS</span></h2>
<div class="controls">
{
"workbench.colorTheme": "Material Theme Darker High Contrast",
"materialTheme.fixIconsRunning": false,
"workbench.iconTheme": "eq-material-theme-icons-darker",
"vim.easymotion": true,
"vim.sneak": true,
"vim.incsearch": true,
"vim.useSystemClipboard": true,
"vim.useCtrlKeys": false,
"vim.hlsearch": true,