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 node | |
| /** | |
| * Create top contributors list for a GitHub organization. | |
| * Usage: ./gh-org-top-contributors.ts <org-name> | |
| */ | |
| const accessToken = process.env.GITHUB_TOKEN || process.env.GH_TOKEN || 'your-token' | |
| const headers = { | |
| Authorization: `token ${accessToken}`, |
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
| #!/bin/bash | |
| # This is a copy of: | |
| # https://gist.github.com/wojtekmaj/6defa1f358daae28bd52b7b6dbeb7ab6 | |
| # read the comments | |
| # Also: npx codemod jest/vitest | |
| # Ensure we're working on the latest version of the main branch | |
| # git switch develop | |
| # git fetch |
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 fs = require('node:fs') | |
| const path = require('node:path') | |
| const glob = require('glob') | |
| // Find all Vue files | |
| const vueFiles = glob.sync(path.join(__dirname, '../**/*.vue')) | |
| vueFiles.forEach(filePath => { | |
| let content = fs.readFileSync(filePath, 'utf8') |
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 <windows.h> | |
| #include <iostream> | |
| #include <string> | |
| enum mode {unknown, open, playing, paused, stopped }; | |
| class MCI | |
| { | |
| // davidxl.blogspot.com | |
| private: |
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 StrTrimLeft(char *source, char *dest) | |
| { | |
| int nIndex = 0; | |
| while (source[nIndex] == ' ') | |
| nIndex++; | |
| strcpy(dest, &source[nIndex]); | |
| } |
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 removeQuotes(LPSTR szCommand) | |
| { | |
| int nGet = 0, nSet = 0; | |
| while (szCommand[nGet] != '\0') | |
| { | |
| if (szCommand[nGet] == '\"') | |
| nGet++; | |
| else | |
| { |
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
| //Display 'Open File' dialog-box | |
| BOOL OpenFileDialog(LPSTR lpFilename) | |
| { | |
| OPENFILENAME of; | |
| char szFilter[] = "Music Files (*.ogg)\0*.ogg\0Image Files (*.png)\0*.png\0All files (*.*)\0*.*\0\0"; | |
| char szFile[MAX_PATH] = "\0"; | |
| char szTitle[] = "Select a file"; | |
| char szExt[] = "ogg"; | |
| of.lStructSize = sizeof(of); |
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 <windows.h> | |
| int main() | |
| { | |
| int width = GetSystemMetrics(SM_CXVIRTUALSCREEN); | |
| int height = GetSystemMetrics(SM_CYVIRTUALSCREEN); | |
| int top = GetSystemMetrics(SM_YVIRTUALSCREEN); | |
| int left = GetSystemMetrics(SM_XVIRTUALSCREEN); | |
| int size = width * height * 3; | |
| int headerSize = sizeof(BITMAPINFOHEADER) + sizeof(BITMAPFILEHEADER); |
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 <windows.h> | |
| #include <Shlwapi.h> | |
| #include <stdio.h> | |
| #pragma comment(lib, "shlwapi.lib") | |
| char* assocStr[] = | |
| { | |
| "ASSOCSTR_COMMAND", | |
| "ASSOCSTR_EXECUTABLE", | |
| "ASSOCSTR_FRIENDLYDOCNAME", |
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 <windows.h> | |
| int main() | |
| { | |
| //allocate a data | |
| INPUT *data = new INPUT[3]; | |
| // Move to position. data | |
| data->type = INPUT_MOUSE; | |
| data->mi.dx = 0; // Position x |
NewerOlder