Skip to content

Instantly share code, notes, and snippets.

View randy-johnson's full-sized avatar

Randy Johnson randy-johnson

View GitHub Profile
@randy-johnson
randy-johnson / main.dart
Created February 7, 2023 03:41
fluttering-mirror-3997
class Person {
String? name;
int? age;
//// adding {} allows us to use named arguments
//Shorthand we can use the this in the constructor to auto assign
@randy-johnson
randy-johnson / main.dart
Created February 7, 2023 03:38
quintessential-utopia-9882
class Person {
String? name;
int? age;
//// adding {} allows us to use named arguments
//@required does not work in plain dart
@randy-johnson
randy-johnson / main.dart
Created February 7, 2023 03:36
quintessential-utopia-9882
class Person {
String? name;
int? age;
//// adding {} allows us to use named arguments
Person({String? name, int? age}){
this.name = name;
this.age = age;
@randy-johnson
randy-johnson / main.dart
Created February 7, 2023 03:34
quintessential-utopia-9882
class Person {
String? name;
int? age;
Person(String name, int age){
this.name = name;
this.age = age;
}
@randy-johnson
randy-johnson / main.dart
Created February 7, 2023 03:16
quintessential-utopia-9882
class Person {
String name='Randy';
int age = 30;
}
int addNumbers(int num1, int num2) {
return num1 + num2;
}
@randy-johnson
randy-johnson / main.dart
Created February 7, 2023 02:52
magenta-truth-3547
addNumbers(num1,num2){
return num1+ num2;
}
void main() {
// for (int i = 0; i < 5; i++) {
// print('hello ${i + 1}');
// }
addNumbers(1,23);
}
@randy-johnson
randy-johnson / s3cmd.md
Created August 31, 2022 11:31 — forked from abhinavmsra/s3cmd.md
Install s3cmd on CentOs

Installing s3cmd on CentOs

  1. As a superuser, go to /etc/yum.repos.d

    cd /etc/yum.repos.d

  2. Download the repo file

    wget http://s3tools.org/repo/RHEL_6/s3tools.repo

@randy-johnson
randy-johnson / gist:1d71ad3d71034847b96f7071b50665a6
Created April 7, 2022 11:35 — forked from steveheinsch/gist:287edd5ce26e608b06b20af384f4cc1e
Function to retrieve all lookup key/values for a Resource/Class in PHRETS 2+
<?php
// Note: $this->server is a "logged in" PHRETS $session
public function getLookupValues($resourceName, $className)
{
$results = array();
// Get Table Metadata for this resource/class
$tableMeta = $this->server->GetTableMetadata($resourceName, $className);
@randy-johnson
randy-johnson / passwordCheck.cfm
Last active September 25, 2021 17:15
CFML PasswordCheck
<cfscript>
/* Based on the passwordCheck tag version by Scott Stroz
https://cflib.org/udf/passwordCheck
Handy Dandy character class cheat sheet
https://www.petefreitag.com/cheatsheets/regex/character-classes/
*/
function passwordCheck(required string password, string CharOpts="alpha,digit,punct,lower,upper", numeric typesRequired="5",numeric length='8' ){
transaction {
try {
// code to run
transaction action="commit";
}
catch(any e) {
transaction action="rollback";
}
}