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: make-it-happen | |
| description: 基于 Figma 设计稿端到端实功能——涵盖业务需求梳理、API 集成、状态管理、错误处理、订阅检查、i18n、视觉还原和组件映射。当用户提供 Figma URL、提到"实现设计"、"从 Figma 构建",或需要根据 Figma 规范开发前端功能时触发。需要 Figma MCP 服务器连接。 | |
| metadata: | |
| mcp-server: figma | |
| filePattern: "apps/**/*.tsx" | |
| --- | |
| # 基于 Figma 实现设计 |
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 provider = createOpenAI({ | |
| baseURL: 'https://api.minimax.io/v1', | |
| apiKey: process.env.MINIMAX_API_KEY, | |
| fetch: async (url, options) => { | |
| if (options.body) { | |
| const body = JSON.parse(options.body as string); | |
| body.reasoning_split = true; | |
| options.body = JSON.stringify(body); | |
| } | |
| const response = await fetch(url, options); |
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
| class Callme { | |
| void call(String message) { | |
| try { | |
| Thread.sleep(1000); | |
| } catch(InterruptedException e) { | |
| System.out.println("Interrupted. Message is " + message); | |
| } | |
| System.out.print("[" + message); | |
| System.out.println("]"); |
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
| (function(P) { | |
| var timer = setInterval(function() { | |
| var requestCount = P.getEntriesByType("resources").filter(res => res.initiatorType === "script" && res.responseEnd === 0).length; | |
| if (requestCount === 0) { | |
| // all requests are loaded | |
| // begin next step here... | |
| clearInterval(timer); | |
| } | |
| }, 16 * 4); // interval set to approx. 100ms |
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
| #Uses python3 | |
| import sys | |
| import math | |
| class Node: | |
| def __init__(self, coords): | |
| self.left = None | |
| self.right = None | |
| self.coords = coords |
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
| void merge_sort(vector<int> &a, int left, int right) { | |
| // base case | |
| if (left + 1 >= right) { | |
| return; | |
| } | |
| // recursion case | |
| int mid = (left + right) / 2; | |
| merge_sort(a, left, mid); | |
| merge_sort(a, mid, right); |
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
| var LEFT = 0; | |
| var RIGHT = 1; | |
| function getZeros(length) { | |
| return (new Array(length)).join('a').split('a').map(function() { return 0; }); | |
| } | |
| function padTo(array, length, direction) { | |
| var result = array.slice(0); | |
| var args = getZeros(length); |
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
| var WebpackDevServer = require('webpack-dev-server'); | |
| var webpack = require('webpack'); | |
| var devConfig = require('../webpack.config.dev'); | |
| var compiler = webpack(devConfig); | |
| var IPAddress = require('./get-ip')(); | |
| new WebpackDevServer(compiler, { | |
| contentBase: './src', | |
| publicPath: '/assets/', |
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></head> | |
| <body> | |
| <button id="btn" style="transform: scale(3); margin: 100px;">touch to play</button> | |
| </body> | |
| <script> | |
| $el = document.querySelector('#btn'); | |
| var myContext = new (window.AudioContext || window.webkitAudioContext)(); | |
| var path = 'ended.mp3'; |
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
| AudioComponent.prototype.initFromBuffer = function(bufferData) { | |
| this.panner = this.context.createPanner(); | |
| this.gainNode = this.context.createGain(); | |
| this.sourceNode = this.context.createBufferSource(); | |
| this.context.decodeAudioData(bufferData, function(buffer) { | |
| this.meta.duration = 1000 * buffer.duration; //in milliseconds | |
| // connect them up | |
| this.sourceNode = buffer; |
NewerOlder