\ escape
^ match start (or negate group)
$ match end
. match any character (except newlines, [\s\S] to match newlines too)
[] match range (see examples below)
[^] negative match range, such as [^<]* (match up to but not including the next `<`)
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
import sys | |
import io | |
sys.stdout = io.TextIOWrapper(sys.stdout.detach(), encoding = 'utf-8') | |
sys.stderr = io.TextIOWrapper(sys.stderr.detach(), encoding = 'utf-8') | |
class Contact: | |
def __init__(self, name, pnum, email, addr): | |
self.name=name | |
self.pnum=pnum | |
self.email=email |
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
[ | |
{ | |
"name": "Worldwide", | |
"placeType": { | |
"code": 19, | |
"name": "Supername" | |
}, | |
"url": "http://where.yahooapis.com/v1/place/1", | |
"parentid": 0, | |
"country": "", |
npm init -y
npx jswt init
sqlc.yaml
:
version: "2"
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
// components/CheckoutForm.tsx | |
import React, { useState } from 'react'; | |
import { loadStripe } from '@stripe/stripe-js'; | |
import { Elements, CardElement, useStripe, useElements } from '@stripe/react-stripe-js'; | |
import axios from 'axios'; | |
const stripePromise = loadStripe(process.env.NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY as string); | |
const CheckoutForm: React.FC = () => { |
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
import java.io.*; | |
import java.net.*; | |
import com.google.gson.*; | |
class HelloWorldApp { | |
public static void main(String[] args) { | |
try { | |
StringBuilder result = new StringBuilder(); | |
URL url = new URL("https://challenges.hackajob.co/swapi/api/films/?format=json"); | |
HttpURLConnection conn = (HttpURLConnection) url.openConnection(); |
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
#include <iostream> | |
#include <jsoncpp/json/json.h> | |
#include <curl/curl.h> | |
using namespace std; | |
static size_t WriteCallback(void *contents, size_t size, size_t nmemb, void *userp) | |
{ | |
((std::string*)userp)->append((char*)contents, size * nmemb); | |
return size * nmemb; |
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
import React, { useState } from "react"; | |
import { auth } from "../firebase"; | |
import { | |
signInWithPopup, | |
GoogleAuthProvider, | |
AuthProvider, | |
getAuth | |
} from "firebase/auth"; | |
import { useAuthState } from "react-firebase-hooks/auth"; |
NewerOlder