Skip to content

Instantly share code, notes, and snippets.

View musoftware's full-sized avatar
🌏
Working from home

Musoftware musoftware

🌏
Working from home
View GitHub Profile
@musoftware
musoftware / file.json
Created January 13, 2024 11:06
Country ISO json
{
AF: "Afghanistan",
AX: "\xc5land Islands",
AL: "Albania",
DZ: "Algeria",
AS: "American Samoa",
AD: "Andorra",
AO: "Angola",
AI: "Anguilla",
AQ: "Antarctica",
@musoftware
musoftware / php72.bat
Created April 7, 2023 01:30
PHP Version with just Batch File to Access directly without Change Enviroment
@echo off
if "%1"=="" (
echo No arguments provided.
exit /b
)
set args=%*
C:/tools/php72/php.exe %args%
1 : Shutdown or Quit your XAMPP server from Xampp control panel.
2 : Download the ZIP version of MariaDB
3 : Rename the xampp/mysql folder to mysql_old.
4 : Unzip or Extract the contents of the MariaDB ZIP file into your XAMPP folder.
5 : Rename the MariaDB folder, called something like mariadb-5.5.37-win32, to mysql.
6 : Rename xampp/mysql/data to data_old.
7 : Copy the xampp/mysql_old/data folder to xampp/mysql/.
8 : Copy the xampp/mysql_old/backup folder to xampp/mysql/.
9 : Copy the xampp/mysql_old/scripts folder to xampp/mysql/.
@musoftware
musoftware / my.cnf
Created March 4, 2023 17:57
mysql configuration
# * Fine Tuning
key_buffer = 64M
max_allowed_packet = 128M
thread_cache_size = 30
myisam-recover = BACKUP
max_connections = 150
table_open_cache = 2048
thread_concurrency = 10
wait_timeout = 600
@musoftware
musoftware / avoidhang.cs
Created October 25, 2022 11:23
New Avoid Hang
internal class AvoidHang : IDisposable
{
private readonly SemaphoreSlim _semaphore = new System.Threading.SemaphoreSlim(1, 1);
Stopwatch stopwatch = new Stopwatch();
bool _started = true;
public AvoidHang(int fast = 1000)
{
stopwatch.Start();
(new Thread(() =>
@musoftware
musoftware / thread_semaphore.cs
Created October 7, 2022 22:12
Sequence Thread Starting and wait
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace ConsoleApp1
{
internal class Program
@musoftware
musoftware / status.php
Created September 20, 2022 16:08
woo-commerce Status
Array
(
[wc-pending] => Pending payment
[wc-processing] => Processing
[wc-on-hold] => On hold
[wc-completed] => Completed
[wc-cancelled] => Cancelled
[wc-refunded] => Refunded
[wc-failed] => Failed
[wc-checkout-draft] => Draft
@musoftware
musoftware / countries.blade.php
Created June 30, 2022 12:20
Laravel Country List
<select id="country" name="country" class="form-control {{ $errors->has('country') ? 'is-invalid' : '' }}" class="form-control">
<option value="Afghanistan" {{ old('country' == "Afghanistan") ? 'selected' : '' }}>Afghanistan</option>
<option value="Åland Islands" {{ old('country' == "Åland Islands") ? 'selected' : '' }}>Åland Islands</option>
<option value="Albania" {{ old('country' == "Albania") ? 'selected' : '' }}>Albania</option>
<option value="Algeria" {{ old('country' == "Algeria") ? 'selected' : '' }}>Algeria</option>
<option value="American Samoa" {{ old('country' == "American Samoa") ? 'selected' : '' }}>American Samoa</option>
<option value="Andorra" {{ old('country' == "Andorra") ? 'selected' : '' }}>Andorra</option>
<option value="Angola" {{ old('country' == "Angola") ? 'selected' : '' }}>Angola</option>
<option value="Anguilla" {{ old('country' == "Anguilla") ? 'selected' : '' }}>Anguilla</option>
<option value="Antarctica" {{ old('country' == "Antarctica") ? 'selected' : '' }}>Antarctica</option
@musoftware
musoftware / flutter.dart
Created March 13, 2022 22:14
Simple Provider Flutter Example
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
void main() {
runApp(
ChangeNotifierProvider(
create: (_) => Person(name: "Yohan", age: 25),
child: MyApp(),
),
);
@musoftware
musoftware / file.java
Created November 19, 2021 21:56
Social Android Studio
public static Intent getOpenFacebookIntent(Context context) {
try {
context.getPackageManager().getPackageInfo("com.facebook.katana", 0);
Intent intent = new Intent("android.intent.action.VIEW", Uri.parse("fb://page/xxx"));
intent.addFlags(CrashUtils.ErrorDialogData.BINDER_CRASH);
return intent;
} catch (Exception unused) {
return new Intent("android.intent.action.VIEW", Uri.parse("https://www.facebook.com/xxx/"));
}