Skip to content

Instantly share code, notes, and snippets.

@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,
@andredtr
andredtr / gist:1c2bbb542c7f977092502d4ce77b9835
Last active August 5, 2019 05:46
Cloudfunctions event followup
'use strict';
const functions = require('firebase-functions'); // Cloud Functions for Firebase library
const DialogflowApp = require('actions-on-google').DialogflowApp; // Google Assistant helper library
exports.dialogflowFirebaseFulfillment = functions.https.onRequest((request, response) => {
console.log('Dialogflow Request headers: ' + JSON.stringify(request.headers));
console.log('Dialogflow Request body: ' + JSON.stringify(request.body));
if (request.body.result) {
processV1Request(request, response);
} else {