Skip to content

Instantly share code, notes, and snippets.

View RockinPaul's full-sized avatar
🐢

Paul Zarudnev RockinPaul

🐢
  • Amsterdam, Netherlands
View GitHub Profile
@RockinPaul
RockinPaul / config.yml
Created December 6, 2021 01:18 — forked from tasaquino/config.yml
CircleCI configuration for Flutter with flavors and schemes - Configuration to send beta and generate artifacts (prod flavor)
version: 2.1
jobs:
ios_distribute_beta:
macos:
xcode: "10.3.0"
working_directory: ~/flutter-app
steps:
- add_ssh_keys:
fingerprints:
- "ab:ab:ab:ab:ab:ab:ab:ab:ab:ab:ab:ab:ab:ab:ab:ab"
import 'package:flutter/material.dart';
class Bubble extends StatelessWidget {
Bubble({this.message, this.time, this.delivered, this.isMe});
final String message, time;
final delivered, isMe;
@override
Widget build(BuildContext context) {
@RockinPaul
RockinPaul / main.dart
Created October 20, 2020 09:08 — forked from AgainPsychoX/main.dart
Dart: Convert a `String` to a `Uint8List` and `Uint8List` to `String` (UTF-16)
import 'dart:typed_data';
void main() {
// Source
String source = 'Hello! Cześć! 你好! ご挨拶!Привет! ℌ𝔢𝔩𝔩𝔬! 🅗🅔🅛🅛🅞!';
print(source.length.toString() + ': "' + source + '" (' + source.runes.length.toString() + ')');
// String (Dart uses UTF-16) to bytes
var list = new List<int>();
class ScreenOne extends StatefulWidget {
@override
_ScreenOneState createState() => _ScreenOneState();
}
class _ScreenOneState extends State<ScreenOne> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
@RockinPaul
RockinPaul / zsh_set_env.txt
Created November 20, 2019 16:51
How to set environment variables permanently in zsh.
echo 'export ENV_VAR=12345' >> ~/.zshenv
echo $ENV_VAR // perform on relaunch of zsh to check if everything is set properly.
12345
@RockinPaul
RockinPaul / scaling.gml
Last active July 8, 2019 09:41
This scaling solution gives a "best fit", and can easily be adapted to suit your own base game resolution.
// Note that you can call this code in a script
// so that you can simply call the script at the start of each room.
// You can even add a final piece of code to have this
// automatically set all the views in all your rooms
// so that you only need to call it once at the start of the game.
// This code will just loop through every room in your game, destroy the default camera,
// and then create a new camera that is correct for the display size and aspect ratio,
// as well as enable a viewport in the room for the camera to act on.
var _check = true;
@RockinPaul
RockinPaul / main.dart
Created April 2, 2019 18:27 — forked from branflake2267/main.dart
Flutter - Using the future builder with infinite list view.
import 'dart:async';
import 'package:flutter/material.dart';
void main() => runApp(new MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return new MaterialApp(
@RockinPaul
RockinPaul / bash_profile_on_mac
Last active February 13, 2019 16:32
Creating a .bash_profile on your mac
A typical install of OS X won't create a .bash_profile for you. When you want to run functions from your command line, this is a must-have.
Start up Terminal
Type "cd ~/" to go to your home folder
Type "touch .bash_profile" to create your new file.
Edit .bash_profile with your favorite editor (or you can just type "open -e .bash_profile" to open it in TextEdit.
Type ". .bash_profile" to reload .bash_profile and update any functions you add.
/*
@RockinPaul
RockinPaul / ApiService.swift
Last active January 24, 2019 13:32
ApiService: Swift+URLSession
class ApiService {
static let sharedInstance = ApiService()
let BASE_URL = "https://restcountries.eu"
// MARK: - List of countries
func countries(_ completion: @escaping(_ result: [Country]?, _ error: Error?) -> Void) {
let urlString = BASE_URL + "/rest/v2/all"
@RockinPaul
RockinPaul / SwiftBuildWhenSomethingIsWrong.sh
Last active January 16, 2019 06:16
sudo xcode-select --reset swift build
sudo xcode-select --reset
swift build
// The whole process
swift package init --type executable
swift build
swift run <app-name>