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 sharp from 'sharp'; | |
import path from 'path'; | |
import { fileURLToPath } from 'url'; | |
const __filename = fileURLToPath(import.meta.url); | |
const __dirname = path.dirname(__filename); | |
const sizes = [16, 32, 48, 64, 128, 256]; | |
const inputFile = path.join(__dirname, '../public/logo.png'); | |
const outputDir = path.join(__dirname, '../public'); |
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 os | |
from lxml import etree | |
# List of tags to add android:layoutDirection="ltr" | |
ALLOWED_LAYOUT_TAGS = {"RelativeLayout", "LinearLayout", "FrameLayout", "ConstraintLayout"} | |
def process_xml_file(file_path): | |
try: | |
tree = etree.parse(file_path) | |
root = tree.getroot() |
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
@Commit (Diff of Working State) Please generate a commit message that:", | |
“1. Summarizes the main purpose of the changes”, | |
“2. Follows best practices for commit message formatting”, | |
“3. Includes any relevant details about the implementation or impact”, | |
“4. Mentions any new files added or significant refactoring”, | |
“\nSuggested commit message format:”, | |
“<type>(<scope>): <subject>”, | |
“”, | |
“<body>”, | |
“”, |
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
// Based on https://gist.github.com/appsbynight/3681050 by Matt Di Pasquale | |
// Author: Victor Corvalan | |
// http://twitter.com/pescadon | |
// This script will generate squares and wide Icons & Tiles required for Windows Store build on Unity3D | |
// Prepare 1 big icon of 512x512px | |
// Open this script with Photoshop -> File -> Scripts -> Browse | |
// Load your icon when prompted | |
var destFolder; | |
try |
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 os | |
import shutil | |
def extract_jpg_files(root_folder): | |
for root, dirs, files in os.walk(root_folder): | |
for file in files: | |
if file.endswith('.jpg'): | |
source_path = os.path.join(root, file) | |
destination_path = os.path.join(root_folder, file) | |
shutil.move(source_path, destination_path) |
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
# This is a function for capturing screenshots with GDScript | |
func screenshot(): | |
# Capture the screenshot | |
var size = OS.window_size | |
var image = get_viewport().get_texture().get_data() | |
# Setup path and screenshot filename | |
var date = OS.get_datetime() | |
var path = "user://screenshots" | |
var file_name = "screenshot-%d-%02d-%02dT%02d:%02d:%02d" % [date.year, date.month, date.day, date.hour, date.minute, date.second] |
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
public class ScreenShooter : MonoBehaviour { | |
private int _count = 0; | |
// Update is called once per frame | |
private void Update() { | |
if ( Input.GetKeyDown( KeyCode.S ) ) { | |
while ( System.IO.File.Exists( "ScreenShot_" + _count + "_" + Screen.width + "x" + Screen.height + ".png" ) ) { | |
_count++; | |
} | |
ScreenCapture.CaptureScreenshot( "ScreenShot_" + _count + "_" + Screen.width + "x" + Screen.height + ".png" ); | |
} |
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
void main() { | |
final configuredApp = AppConfig( | |
appName: 'App', | |
flavorName: 'uat', | |
apiBaseUrl: uatServerUrl, | |
coreAppBaseUrl: uatServerCoreUrl, | |
child: App( | |
WebService.create(uatServerUrl), | |
StorageServiceImpl(), | |
CoreAppWebService.create(uatServerCoreUrl), |
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
class AppConfig extends InheritedWidget { | |
const AppConfig({ | |
Key? key, | |
required this.appName, | |
required this.flavorName, | |
required this.apiBaseUrl, | |
required this.coreAppBaseUrl, | |
required Widget child, | |
}) : super(child: child); |
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
class StringHelper { | |
static String removeAllHtmlTags(String htmlText) { | |
final RegExp exp = RegExp("<[^>]*>", multiLine: true); | |
return htmlText.replaceAll(exp, ''); | |
} | |
static String shrinkSecondName(String? name) { | |
if (name != null && name.isNotEmpty) { | |
final nameStr = name.split(' '); |
NewerOlder