Skip to content

Instantly share code, notes, and snippets.

View v1vendi's full-sized avatar

Ilya Komsa v1vendi

View GitHub Profile
@v1vendi
v1vendi / GameLiftGameModeExample.cpp
Created September 27, 2022 14:15
GameLiftGameServer plugin documentation
// Copyright Illia Komsa 2022. All rights reserved.
#include "GameFramework/GameModeBase.h"
#include "GameFramework/PlayerState.h"
#include "Kismet/GameplayStatics.h"
#include "GameLiftGameModeExample.generated.h"
/**
* An example PlayerSession class, that adds property to store PlayerSessionId
*/
UCLASS(Abstract)
@sonibla
sonibla / download-github-private-asset.ps1
Created November 29, 2021 10:39
Download assets from private Github releases using PowerShell
$credentials="<github_access_token>"
$repo = "<user_or_org>/<repo_name>"
$file = "<name_of_asset_file>"
$headers = New-Object "System.Collections.Generic.Dictionary[[String],[String]]"
$headers.Add("Authorization", "token $credentials")
$releases = "https://api.github.com/repos/$repo/releases"
Write-Host Determining latest release
$id = ((Invoke-WebRequest $releases -Headers $headers | ConvertFrom-Json)[0].assets | where { $_.name -eq $file })[0].id
@pokidovea
pokidovea / confirmation-dialog.js
Created December 11, 2018 19:02
A confirmation dialog on React
import React from 'react'
import ReactDOM from 'react-dom'
import PropTypes from 'prop-types'
import { Modal, ModalHeader, ModalBody, ModalFooter, Button } from 'reactstrap'
const ConfirmationModal = props => {
return (
<Modal isOpen={true} toggle={props.onNo} backdrop={true}>
<ModalHeader toggle={props.onNo}>{props.title}</ModalHeader>
@colegeissinger
colegeissinger / input.js
Created September 5, 2015 00:48
Fixing ACF Pro so the dreded "isArrayLike empty obj error" is avoided
acf.add_filter('validation_complete', function( json, $form ){
// Return early if there are no errors.
// This will avoid the dreded "isArrayLike empty obj error"
// https://github.com/jquery/jquery/issues/2242
if ( 0 === json.errors ) {
return json;
}
// show field error messages