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
| <?php | |
| // connect to the database | |
| $pdo = new PDO('sqlite:todo.db'); | |
| $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); | |
| $pdo->setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_ASSOC); | |
| // create the table if it doesn't exist | |
| $pdo->exec("CREATE TABLE IF NOT EXISTS todos ( | |
| id INTEGER PRIMARY KEY, |
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
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <title>Screen Capture</title> | |
| <meta name="viewport" content="width=device-width, initial-scale=1"> | |
| </head> |
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
| const libc = Deno.dlopen( | |
| "libc.so.6", | |
| { | |
| dup2: { | |
| parameters: ["i32", "i32"], | |
| result: "i32", | |
| }, | |
| errno: { | |
| type: "i32", | |
| }, |
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
| #!/usr/bin/env -S /home/garciat/homebrew/bin/deno --allow-env --allow-run --allow-read --allow-write --allow-net | |
| import "jsr:@std/dotenv/load"; | |
| import { readAllSync } from "jsr:@std/io/read-all"; | |
| import { writeAllSync } from "jsr:@std/io/write-all"; | |
| import { deleteCookie, getCookies, setCookie } from "jsr:@std/http/cookie"; | |
| import { Application, Context, Router } from "jsr:@oak/oak"; |
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
| # pip install google-api-python-client python-dotenv | |
| from typing import Optional, List, Tuple, Dict | |
| from dataclasses import dataclass | |
| import http.cookies | |
| import os | |
| import subprocess | |
| import sys | |
| import urllib.parse |
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
| <?php | |
| function println($s) | |
| { | |
| echo "$s\n"; | |
| } | |
| function shell_exec_trim($cmd, $nonzero_throw = true) | |
| { | |
| $lines = array(); |
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
| type KeyEnumOf<T> = {[P in keyof T]: P} | |
| class Enum { | |
| static make<T>(source: T): Readonly<KeyEnumOf<T>> { | |
| let result = {} as KeyEnumOf<T>; | |
| for (const k in source) { | |
| result[k] = k; | |
| } | |
| return Object.freeze(result); | |
| } |
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
| package main | |
| import "fmt" | |
| // ------------------------------------------------ | |
| type F1[T any, R any] interface { | |
| Apply(T) R | |
| } |
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
| package com.example.stages; | |
| import java.util.Optional; | |
| interface Person<Name, Age> { | |
| Name name(); | |
| Age age(); | |
| } | |
| record Person_Any<Name, Age>(Name name, Age age) implements Person<Name, Age> {} |
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
| package com.uber.money.caribbean.paymentprofilev2.spring; | |
| import com.fasterxml.jackson.core.JsonProcessingException; | |
| import com.fasterxml.jackson.databind.JsonNode; | |
| import com.fasterxml.jackson.databind.ObjectMapper; | |
| import com.fasterxml.jackson.databind.node.ArrayNode; | |
| import com.fasterxml.jackson.databind.node.BooleanNode; | |
| import com.fasterxml.jackson.databind.node.DoubleNode; | |
| import com.fasterxml.jackson.databind.node.JsonNodeFactory; | |
| import com.fasterxml.jackson.databind.node.LongNode; |