Skip to content

Instantly share code, notes, and snippets.

View richard457's full-sized avatar
🎯
Focusing

Muragijimana richard457

🎯
Focusing
View GitHub Profile
@richard457
richard457 / main.dart
Last active July 11, 2023 15:23
Rounded shape
import 'package:flutter/material.dart';
void main() {
runApp(const FigmaToCodeApp());
}
// Generated by: https://www.figma.com/community/plugin/842128343887142055/
class FigmaToCodeApp extends StatelessWidget {
const FigmaToCodeApp({super.key});
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@richard457
richard457 / main.dart
Last active May 24, 2022 17:37
InvoiceGenerator
import 'dart:math';
import 'package:intl/intl.dart';
import 'dart:math' as math;
void main() {
var random = math.Random();
var randomNumber = '';
for (var i = 0; i < 10; i++) {
randomNumber += random.nextInt(10).toString();
}
@richard457
richard457 / example.nginx
Created May 14, 2022 18:40 — forked from gsanders5/example.nginx
Automatic nginx virtual subdomains with sub-folders or sub-directories
# Automatic nginx virtual subdomains with sub-folders or sub-directories
#
# Since the original source where I found this code is now offline, I have decided to mirror it here.
# All credit goes to: http://web.archive.org/web/20150307193208/http://www.messaliberty.com/2010/10/automatic-nginx-virtual-subdomains-with-sub-folders-or-sub-directories
#
# Description: In my web root directory I wanted create a folder called photos, and another called
# music using a sftp program. Without manually going back to the config file or to the shell I like to
# be able to access them at photos.nginxdomain.com and music.nginxdomain.com. That is what this config does.
# Redirect visitors from http://nginxdomain.com/ to http://www.nginxdomain.com/
@richard457
richard457 / RotateArrayByKStep
Created February 20, 2021 18:49
Rotate Array given K step.
public static void rotate(int [] arr, int k){
int j =0;
while(k>0){
int temp = arr[arr.lenght -1]
for(j=arr.lenght -1; j>0; j--){
arr[j] = arr[j-1]
}
arr[j] = temp;
k--;
}
@richard457
richard457 / main.dart
Created September 16, 2020 07:24
Text does not start on the same line.
import 'package:flutter/material.dart';
final Color darkBlue = Color.fromARGB(255, 18, 32, 47);
void main() {
runApp(MyApp());
}
class User{
List<String> numbers;
}
import 'package:flutter/material.dart';
class CustomSliderThumbCircle extends SliderComponentShape {
final double thumbRadius;
final int min;
final int max;
const CustomSliderThumbCircle({
@required this.thumbRadius,
this.min = 0,
<?php
// GET
$request = $client->get($url, array('Accept' => 'application/json'));
$response = $request->send();
if ($response->getStatusCode() < 200 || $response->getStatusCode() >= 300) {
// Error
}
@richard457
richard457 / migration.php
Created March 19, 2019 09:55 — forked from jakzaizzat/migration.php
Update ENUM value in Laravel Migration
DB::statement("ALTER TABLE roles CHANGE COLUMN role role ENUM('system admin', 'super admin', 'admin staff', 'instructor', 'customer', 'gym member', 'swim member')");