Skip to content

Instantly share code, notes, and snippets.

View team55's full-sized avatar

Butakov Igor team55

View GitHub Profile
@team55
team55 / invalidate.sh
Created July 1, 2022 13:42 — forked from jenseickmeyer/invalidate.sh
Script for invalidation a CloudFront Distribution
#!/bin/bash
DISTRIBUTION_ID=
#Invalidate the CloudFront Distribution
invalidation_id=$(aws cloudfront create-invalidation --distribution-id $DISTRIBUTION_ID --paths "/*" --query Invalidation.Id)
length=${#invalidation_id}
# Wait for invalidation to finish
aws cloudfront wait invalidation-completed --distribution-id $DISTRIBUTION_ID --id ${invalidation_id:1:$length-2}
@team55
team55 / flutter.md
Created April 28, 2019 13:03 — forked from matteocrippa/flutter.md
Flutter Cheatsheet

Flutter

A quick cheatsheet of useful snippet for Flutter

Widget

A widget is the basic type of controller in Flutter Material. There are two type of basic Widget we can extend our classes: StatefulWidget or StatelessWidget.

Stateful

StatefulWidget are all the widget that interally have a dynamic value that can change during usage. It can receive an input value in the constructor or reference to functions. You need to create two classes like:

  1. ownload mojave installer -> app store
  2. formatting usb: diskutil partitionDisk /dev/disk1 2 MBR FAT32 "CLOVER EFI" 200Mi HFS+J "install_osx" R

install https://bitbucket.org/RehabMan/clover/downloads/Clover_v2.4k_r4701.RM-4963.ca6cca7c.zip to CLOVER Partition

For Clover UEFI, run the Clover Installer package:

  • if using MBR, select the target of the install to "CLOVER EFI" using "Change Install Location"
  • select "Customize" (the default is a legacy install -- we need to change it)
/**
* The MIT License (MIT)
*
* Copyright (c) 2015 Circle Internet Financial
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
public class GridActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.grid);
final GridViewPager mGridPager = (GridViewPager) findViewById(R.id.pager);
mGridPager.setAdapter(new SampleGridPagerAdapter(this, getFragmentManager()));
}
/*
* Copyright 2014 Chris Banes
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
def toCamelCase(String string) {
String result = ""
string.findAll("[^\\W]+") { String word ->
result += word.capitalize()
}
return result
}
afterEvaluate { project ->
Configuration runtimeConfiguration = project.configurations.getByName('compile')
struct Fahrenheit {
var temperature: Double
init() {
temperature = 32.0
}
}
var f = Fahrenheit()
println("The default temperature is \(f.temperature)° Fahrenheit")
// prints "The default temperature is 32.0° Fahrenheit"
package com.example.untitled;
import android.app.Activity;
import android.os.Bundle;
public class MyActivity extends Activity
{
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
setContentView(R.layout.main);