Example of an automated script that does most of this: https://github.com/surpher/PactSwiftMockServer/blob/fb8148866bb05f49a0b1dcaae66c67bad1e7eca7/Support/build_rust_dependencies
curl https://sh.rustup.rs -sSf | sh
Example of an automated script that does most of this: https://github.com/surpher/PactSwiftMockServer/blob/fb8148866bb05f49a0b1dcaae66c67bad1e7eca7/Support/build_rust_dependencies
curl https://sh.rustup.rs -sSf | sh
#!/bin/bash | |
# Requires 'fzf' | |
# check_dependency fzf git || exit 1 | |
HELP_TEXT=" | |
git fuzzy-checkout | |
Check out branches quickly with the power of \`fzf\`. | |
Default view is local branches (HEADS). |
name: Security audit | |
on: | |
schedule: | |
- cron: '0 0 * * *' | |
push: | |
paths: | |
- '**/Cargo.toml' | |
- '**/Cargo.lock' | |
jobs: | |
security_audit: |
const { execSync } = require('child_process') | |
const { createHash } = require('crypto') | |
const invertColor = require('invert-color') | |
const branchName = execSync('git rev-parse --abbrev-ref HEAD') | |
const hash = createHash('sha256') | |
hash.update(branchName) | |
const color = '#' + hash.digest().toString('hex').substring(0, 6) | |
const invertedColor = invertColor(color, true) |
/* | |
Copy this into the console of any web page that is interactive and doesn't | |
do hard reloads. You will hear your DOM changes as different pitches of | |
audio. | |
I have found this interesting for debugging, but also fun to hear web pages | |
render like UIs do in movies. | |
*/ | |
const audioCtx = new (window.AudioContext || window.webkitAudioContext)() |
#!/usr/bin/env python3 | |
""" | |
This processes TiddlyWiki dumps to stick them into a format that Bear can import. | |
Full steps: | |
* First in your TiddlyWiki under the Tools menu click "export all>Static HTML". | |
* Next, run this command `process_tiddly_export --tiddler_dump_file=somewhere/tiddlers.html --output_directory=/tmp/some_empty_folder/ --extra_tags=any,tags,you,want` it will | |
* process the static HTML file into one file per tiddler | |
* each file will start with <h1>your tiddler title</h1> | |
* next it will list any #tags on the original tiddler as well as and extra tags you supplied |
Your task is now to create a user authentication system.
This document will guide you through all the features and implication of such system, so that you don't have to search them yourself.
We will focus on web/browser-technologies, however similar concept can be widely applied. This guide, is a work in progress, feel free to comment and provide feedbacks.
const React = require('react') | |
const ReactDOMServer = require('react-dom/server') | |
const { createServer } = require('http') | |
const App = require('./build/static/js/main.49fed57c').default | |
createServer((req, res) => { | |
const el = React.createElement(App) | |
const html = ReactDOMServer.renderToString(el) | |
res.write(html) | |
res.end() |
import { ApolloServer, gql } from 'apollo-server-micro'; | |
const typeDefs = gql` | |
type Query { | |
sayHello: String | |
} | |
`; | |
const resolvers = { | |
Query: { |
import React, { useEffect } from "react" | |
import useFetch from "./useFetch" | |
export default function ProcessingPurchase({ | |
send, | |
context: { workshopData, ticketsToPurchase, stripeToken } | |
}) { | |
let [charge, error] = useFetch("/purchaseWorkshop", { | |
workshopId: workshopData.id, | |
ticketsToPurchase, |