Skip to content

Instantly share code, notes, and snippets.

View ismyhc's full-sized avatar

Jacob Davis ismyhc

View GitHub Profile

Keybase proof

I hereby claim:

  • I am ismyhc on github.
  • I am jdavis80 (https://keybase.io/jdavis80) on keybase.
  • I have a public key ASD-nCs3hOMBHRUDtHo-QwLtooxnbDy0gLvSklmOom9JFAo

To claim this, I am signing this object:

@ismyhc
ismyhc / container.ts
Created January 23, 2020 14:42
Simple container
import 'phaser';
import BasicButton from './BasicButton';
import GameService from '../services/GameService';
export default class GameInfoContainer extends Phaser.GameObjects.Container {
background: Phaser.GameObjects.Image;
resetButton: BasicButton;
callback: () => void;
rpcProvider.getAccount(requestParameters: accountNameRequst) { result in
switch result {
case .success(let acc):
self.finish(retval: acc, error: nil)
case .failure(let error):
self.finish(retval: nil, error: OperationError.dataFailure("No Account found \(error.localizedDescription)"))
}
}
func getRequestJSON(withPath path: String, completion: OperationCompletion) {
let session = URLSession.shared
let url = URL(string: path)!
let task = session.dataTask(with: url) { data, response, error in
if error != nil || data == nil {
print("Client error!")
DispatchQueue.main.async {
@ismyhc
ismyhc / gist:76caf743bdcdb8572fc2ae06eaf455d5
Created September 16, 2019 13:22
Bet Pink easy button
<a class="gradient-button" href="https://magic.lynxwallet.io/tLzW" target="_blank">
<img class="lynx-logo" src="https://developers.lynxwallet.io/images/lynx-logo.svg" alt="Lynx Logo" />
<span>CONNECT WITH LYNX</span>
</a>
.gradient-button {
position: relative;
border-radius: 4px;
font-family: 'Open Sans', sans-serif;
font-weight: 600;
{"tokens":["eosadddddddd:ADD","buildertoken:ADE","auctionnet11:ANC","anoxanoxanox:ANX","aeronaerozzz:ARN","assettokenio:ASSET","eosatidiumio:ATD","novusphereio:ATMOS","thebeantoken:BEAN","eosgamecoin2:BEST","betdividends:BET","thebetxtoken:BETX","bgbgbgbgbgbg:BG","bingobetoken:BINGO","betkingtoken:BKT","eosblackteam:BLACK","bntbntbntbnt:BNT","eosbocai1111:BOCAI","boidcomtoken:BOID","bosredsystem:BOSRED","openbrmeos11:BRM","bondavinciio:BSD","eosbuttonbtn:BTN","buff123token:BUFF","eoscancancan:CAN","eoscandymain:CANDY","carmeltokens:CARMEL","tokenbyeocat:CAT","eosiochaince:CET","bet24tokens1:CHIP","challengedac:CHL","funcitytoken:CITY","eoscrashplay:CRASH","creditmanage:CRE","dacincubator:CTN","eoscubetoken:CUBE","stablecarbon:CUSD","eoscafekorea:DAB","dappservices:DAPP","dbetminepool:DBET","thedeosgames:DEOS","diceeostoken:DET","betdicetoken:DICE","eosdyeosiody:DY","eosauctionpt:EAP","eatscience14:EATCOIN","bitpietokens:EBTC","horustokenio:ECASH","ectchaincoin:ECTT","ednazztokens:EDNA","bitpietokens:EETH","et
@ismyhc
ismyhc / gist:f27ea5799fd366285e8b7e598e797289
Created October 29, 2018 20:40
lynx-scatter-wrapper.js
class LynxScatterWrapper {
getIdentity(requiredFields) {
//.. open your authentication popup, return:
return new Promise((resolve, reject) => {
this.identity = { accounts: [{ blockchain: 'eos', name: 'jakejakejake', authority: 'active' }] };
resolve(this.identity);
});
}
function sanitizeTag(input) {
var retval = input;
retval = retval.replace(/[&;$%@"<>()+,.#\/\\\[\]]/g, "") // remove non approved characters
retval = retval.trim(); // remove leading and trailing whitespace
retval = retval.replace(/\s+/g, "-"); // condense and replace inner whitespace with -
retval = retval.replace(/^[0-9]+/, ""); // remove leading numbers
retval = retval.toLowerCase();
return retval
}
@ismyhc
ismyhc / Enemy Loop.cs
Created March 4, 2013 22:38
Enemy Loop
for(int p = _player.Count-1; p >= 0; p--)
{
Player player = _player[p];
player.UpdateLocalVertices();
Rect playerRect = player.GetTextureRectRelativeToContainer();
if(_player.Count == 0) break;
// Handle player/enemy collisions
@ismyhc
ismyhc / Enemy Update Method.cs
Last active December 14, 2015 12:28
Enemy Update method
if(groupedMovement)
{
// When hitting right side of the screen set direction to left
if(this.x > (Futile.screen.halfWidth - GMain.instance.gameScreenOffset) - (this.width / 2))
{
GMain.instance.enemyHorizontalDirection = "left";
}
// When hitting left side of the screen set direction to right