Skip to content

Instantly share code, notes, and snippets.

Robert RobertApikyan

Block or report user

Report or block RobertApikyan

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View Permissions map
[
{
"key":"home_tab",
"isEnabled":true,
"items":[
{
"key":"user_profile",
"isEnabled":true,
"items":[
View gist:65f0a2b9bbee82cc1e415e9bdf3dabb0
{ companies ->
val ac = mutableListOf<Company.UserAccessViewModel>()
for (company in companies) {
val status = UserManegmentCompanyStatus.firstOrUndefined(company.approvalStatus)
val hasAccess = userCompanyList.indexOfFirst { it.id == company.id }.isNotUndefined
if (status == UserManegmentCompanyStatus.APPROVED || (status == UserManegmentCompanyStatus.WAITING && hasAccess)) {
ac.add(Company.UserAccessViewModel(company, hasAccess))
}
View gist:ab4b07478b851e49d3d5f033976d6ed5
{
"error": {
"code": 1018,
"displayMessage": "An error occurred during the activation of a particular registration. See the inner exception for details. Registration: Activator = TimeOffsMService (ReflectionActivator), Services = [Raiser.Services.ITimeOffsMService], Lifetime = Autofac.Core.Lifetime.CurrentScopeLifetime, Sharing = None, Ownership = OwnedByLifetimeScope ---> An error occurred during the activation of a particular registration. See the inner exception for details. Registration: Activator = IEmployeeProvider (DelegateActivator), Services = [Raiser.Services.IEmployeeProvider], Lifetime = Autofac.Core.Lifetime.CurrentScopeLifetime, Sharing = Shared, Ownership = OwnedByLifetimeScope ---> Invalid column name 'Extension'. (See inner exception for details.) (See inner exception for details.)",
"internalMessage": null
},
"status": 1,
"message": null
}
View Stations 1
{
"html_attributions": [],
"next_page_token": "CrQCJAEAAFrjC9x9EzX4hb1IwBO6--geSmzS4nCQdyqLiZEzB85NAIVsAiYSgA4My-quPr--cYkzjrAwsf8eLU6cLRUgZ9KbCi4XhGOLLgfuqnulyokB9V3Xr_8za2XZJY5TV3vtfT59E9uArdAMXxQhEytDGFnfG4JQXlsgmGDHoAdaZmNktFZ6YYpm_LjhsbZPWpDz7edLVpKKfRrViTFN6U_X7Izqb5_fT70M9agfNKWP_s6Bq6f3ok4by-NoGLdgpiQ4QRzMldPH2ok8nRUek-MHYU8J29bua1Iezxa4ocMYlIzScmTnSLzAYnrALBT3qqLxMbJ2_eG6yBE079GAaHZ37Qnn4QS2-f1wNEWx6_wn5wE0vLcsEDfI3LOdlNhVgzvx_N0SuCwecZmtJHnDlIk-rRoSEB2iWNcUwP8bAi9r1TrcZysaFAaDlySguXrwiGmDdOZ9WNO7ryzn",
"results": [
{
"geometry": {
"location": {
"lat": 40.209147,
"lng": 44.5034909
},
View gist:eab7e67712feccac8f403bafc343efc7
[
{
"active":true,
"companyId":508,
"moduleAccessRight":2,
"moduleId":3,
"userId":453
},
{
"active":true,
View gist:c99c3fca6c4d292e763948018d1c3c98
fun Date.toUTC(): Date {
var milliseconds = time
val offset = TimeZone.getDefault().getOffset(milliseconds).toLong()
milliseconds -= offset
return Date(milliseconds)
}
View SendScreenshotDialogFragment.java
public static DialogFragment show(Bitmap bitmap, FragmentManager fragmentManager){
DialogFragment dialog = SendScreenshotDialogFragment.newInstance(bitmap);
dialog.show(fragmentManager, "SendScreenshotDialogFragment");
return dialog;
}
View MapFragment.java
private void onCaptureClick() {
if (mMapBoxMap!=null){
mMapBoxMap.snapshot((Bitmap snapshot) ->
SendScreenshotDialogFragment
.show(snapshot,mainActivity.getSupportFragmentManager()));
}
}
@RobertApikyan
RobertApikyan / MainActivity.kt
Created Mar 23, 2018
MainActivity code for segmented controll
View MainActivity.kt
package example.com.segmentedcontrollsupport
import android.support.v7.app.AppCompatActivity
import android.os.Bundle
import segmented_control.widget.custom.android.com.segmentedcontrol.SegmentedControl
class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
View gist:c718105a7c736f83b90b4b0879373d94
infix fun <T> Boolean.then(param:T):T? = if(this) param else null
infix fun <T> T.ifNot(param: T):T? = if (this.isNull()) param else this
{
val isFirst = false
Log.d("loog","${isFirst then "First" ifNot "Second"}")
}
// output "Second"
You can’t perform that action at this time.