Skip to content

Instantly share code, notes, and snippets.

View AlexKorovyansky's full-sized avatar

Alex Korovyansky AlexKorovyansky

View GitHub Profile
@AlexKorovyansky
AlexKorovyansky / append_to_spreadsheet.dart
Created January 12, 2020 18:15
Append to Spreadsheet
final _credentials = new ServiceAccountCredentials.fromJson(r'''
{
"private_key_id": "***",
"private_key": "***",
"client_email": "***",
"client_id": "***",
"type": "***"
}
''');
@AlexKorovyansky
AlexKorovyansky / main.dart
Last active September 26, 2018 18:10
Blinking todo-app
import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:firebase_database/firebase_database.dart';
import 'package:flutter/rendering.dart';
import 'package:rxdart/rxdart.dart';
import 'dart:async';
void main() {
@AlexKorovyansky
AlexKorovyansky / city-run.gpx
Last active March 25, 2018 03:10
Emulate user running around Apple campus in Android emulator
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<gpx>
<!--Created from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/Frameworks/CoreLocation.framework/Support/SimulationScenarios/City Run.plist-->
<trk>
<trkseg>
<trkpt lat="37.33182081" lon="-122.03038642"></trkpt>
<trkpt lat="37.33181965" lon="-122.03043332"></trkpt>
<trkpt lat="37.33181512" lon="-122.03048154"></trkpt>
<trkpt lat="37.33180957" lon="-122.03053391"></trkpt>
<trkpt lat="37.33180031" lon="-122.03058102"></trkpt>
@AlexKorovyansky
AlexKorovyansky / .bash_profile
Created March 25, 2018 02:42
.bash_profile
if [ -f `brew --prefix`/etc/bash_completion ]; then
. `brew --prefix`/etc/bash_completion
fi
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home
export ANDROID_HOME="$HOME/Library/Android/sdk"
export ANDROID_HOME_PLATFORM_TOOLS="$ANDROID_HOME/platform-tools"
export FASTLANE_HOME="$HOME/.fastlane/bin"
@AlexKorovyansky
AlexKorovyansky / CheckableImageButton.java
Created March 9, 2015 12:52
Implementation of checkable ImageButton, with behaviour similar to Checkbox and support of state_checked selectors. Based on http://kmansoft.com/2011/01/11/checkable-image-button/
public class CheckableImageButton extends ImageButton implements Checkable {
private boolean checked;
private boolean broadcasting;
private OnCheckedChangeListener onCheckedChangeListener;
private static final int[] CHECKED_STATE_SET = { android.R.attr.state_checked };
public CheckableImageButton(Context context) {
@AlexKorovyansky
AlexKorovyansky / .gitconfig
Last active July 31, 2017 04:54
.gitconfig
[user]
name = Alex Korovyansky
email = alexkorovyansky@gmail.com
[core]
excludesfile = /Users/akorovyansky/.gitignore_global
editor = mcedit
autocrlf = input
[push]
@AlexKorovyansky
AlexKorovyansky / .gitignore
Created January 14, 2015 10:32
.gitignore for Android Studio project
.DS_Store
/local.properties
# IDEA/Android Studio project files, because
# the project can be imported from settings.gradle
.idea
*.iml
# Old-style IDEA project files
*.ipr
@AlexKorovyansky
AlexKorovyansky / Main.js
Last active August 29, 2015 14:07
GAS Stuff for transformation Google Form response to Mailchimp subscriber
String.prototype.startsWith=function(str){return this.indexOf(str) == 0;}
String.prototype.trim=function(){return this.replace(/^\s\s*/, '').replace(/\s\s*$/, '');};
var tag = "devfest14_registration";
var spreadSheet = SpreadsheetApp.getActiveSpreadsheet();
var metaSheetResponses = makeMetaSheet(spreadSheet.getSheetByName("Responses"), 2, 0);
var metaRowFlatRange = metaSheetResponses.getMetaRowFlatRange(1);
var emailPositionInDataRange = metaRowFlatRange.positionOf("EMAIL^");
var invitationCodePositionInRange = metaRowFlatRange.positionOf("MERGE_INVCODE^");
var invitationCodeStatusPositionInRange = metaRowFlatRange.positionOf("MERGE_INVSTAT");
var responseStatusPositionInRange = metaRowFlatRange.positionOf(":STATUS");
@AlexKorovyansky
AlexKorovyansky / git-cheatsheet.sh
Last active August 29, 2015 14:07
Git CheatSheet
Rename branch:
git branch -m old_branch new_branch # Rename branch locally
git push origin :old_branch # Delete the old branch
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote
// To be continued
@AlexKorovyansky
AlexKorovyansky / NewRelicSplitApplication.java
Last active March 9, 2021 15:54
Trick for separating Develop from Release versions in New Relic Mobile SDK.
...
NewRelic.withApplicationToken(getString(R.string.my_new_relic_application_token).start(this);
...