This file contains 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/python3 | |
from collections import deque | |
MAX_NUMBER = 18 | |
# Define operations as functions | |
def add(x, y): return x + y | |
def sub(x, y): return x - y | |
def mul(x, y): return x * y |
This file contains 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
/** | |
* @file | |
* ESLint configuration for a monorepo project | |
*/ | |
import { default as pluginTs, Config } from 'typescript-eslint' | |
import { FlatCompat } from '@eslint/eslintrc' | |
import globals from 'globals' | |
import jsdoc from 'eslint-plugin-jsdoc' | |
import pluginJs from '@eslint/js' | |
import pluginJson from 'eslint-plugin-json' |
This file contains 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
//@version=5 | |
indicator("Pivot SRs", overlay=true) | |
lookback = input.int(12, "Lookaround bars") | |
number_of_lines = input.int(5, "Lines to keep") | |
getLastNonNaInfo(series) => | |
float lastValue = na | |
int lastIndex = na | |
for i = 0 to 1000 // Adjust the range as necessary |
This file contains 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
// @version=5 | |
indicator(title="Multi-MA", shorttitle="MA", overlay=true) | |
var string MA_EMA = "EMA" // (Exponential Moving Average)" | |
var string MA_SMA = "SMA" // (Simple Moving Average)" | |
var string MA_WMA = "WMA" // (Weighted Moving Average)" | |
var string MA_HMA = "HMA" // (Hull Moving Average)" | |
var string MA_RMA = "RMA" // (Relative Moving Average)" | |
var string MA_SWMA = "SWMA" // (Symmetrically-Weighted Moving Average)" |
This file contains 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 { defineAsyncComponent } from 'vue' | |
const Content = defineAsyncComponent(() => import('./component-content.js')) | |
export default { | |
name: 'App', | |
components: { Content }, | |
template: /*html*/` | |
<Content /> | |
` |
This file contains 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
/** | |
* Arduino Sketch for Digital Calipers and Dial Indicators Reading | |
* | |
* This sketch is designed to interface with digital calipers or dial indicators, reading measurements | |
* via a simple two-pin setup. It effectively handles data on both rising and falling edges of a clock signal, | |
* managing debouncing and differentiating between measurement units (inches or millimeters). | |
* | |
* Features: | |
* - Uses interrupts to capture data from clock signal changes. | |
* - Debouncing logic for accurate edge detection. |
This file contains 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
// paste this into your chrome dev console for Speech Synthesis | |
const originalFetch = window.fetch | |
const patchedFetch = (...args) => { | |
if (args[1].method == 'POST' && args[1].body.length > 0 && /moderations$/.test(args[0])) { | |
const aiResponse = JSON.parse(args[1].body)["input"].split("\n\n\n") | |
if (aiResponse.length > 1) { | |
const text = aiResponse.slice(1).join(". ").trim() | |
console.log(text) |
This file contains 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
from google.appengine.api import apiproxy_stub | |
from google.appengine.api import apiproxy_stub_map | |
class FetchServiceMock(apiproxy_stub.APIProxyStub): | |
def __init__(self, service_name='urlfetch'): | |
super(FetchServiceMock, self).__init__(service_name) | |
def set_return_values(self, **kwargs): | |
self.return_values = kwargs |
This file contains 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
FROM rust:alpine | |
RUN apk add --no-cache \ | |
bash \ | |
binutils-gold \ | |
ca-certificates \ | |
clang \ | |
curl \ | |
g++ \ | |
git \ |
This file contains 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
// ==UserScript== | |
// @name ChatGPT Speak and Listen | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description try to take over the world! | |
// @author https://gist.github.com/kesor | |
// @downloadURL https://gist.github.com/kesor/fc0d1a9b285011b74670109f22a59670 | |
// @match https://chat.openai.com/chat | |
// @grant unsafeWindow | |
// ==/UserScript== |
NewerOlder