Skip to content

Instantly share code, notes, and snippets.

View chickenfoot88's full-sized avatar
🎓
Improving skills

Adel Ismagilov chickenfoot88

🎓
Improving skills
View GitHub Profile
var roleHarvester = {
/** @param {Creep} creep **/
run: function(creep) {
if(creep.carry.energy < creep.carryCapacity) {
var sources = creep.room.find(FIND_SOURCES);
if(creep.harvest(sources[0]) == ERR_NOT_IN_RANGE) {
creep.moveTo(sources[0], {visualizePathStyle: {stroke: '#ffaa00'}});
}
}
// create creep
Game.spawns['Spawn1'].spawnCreep( [WORK, CARRY, MOVE], 'Harvester1' );
Game.spawns['Spawn1'].spawnCreep( [WORK, CARRY, MOVE], 'Upgrader1' );
Game.spawns['Spawn1'].spawnCreep( [WORK, CARRY, MOVE], 'Builder1',
{ memory: { role: 'builder' } } );
// creeps memories
Game.creeps['Harvester1'].memory.role = 'harvester';
Game.creeps['Upgrader1'].memory.role = 'upgrader';
let isRefreshing = false;
let refreshSubscribers = [];
const instance = axios.create({
baseURL: Config.API_URL,
});
instance.interceptors.response.use(response => {
return response;
}, error => {
@chickenfoot88
chickenfoot88 / index.html
Created October 29, 2018 10:15
Random character transition
<div id="messenger"></div>
$(document).mouseup(function (e) {
var menu = $('.side-menu');
if (e.target !== menu[0] && !menu.has(e.target).length) {
hideSideMenu();
};
});
function mtRand(min, max) {
return Math.floor(Math.random() * (max - min + 1));
}
@chickenfoot88
chickenfoot88 / open-w-atom.reg
Created April 16, 2018 13:58 — forked from kyle-ilantzis/open-w-atom.reg
Adds 'Open in Atom' to context menu in Windows Explorer.
Windows Registry Editor Version 5.00
;
; Adds 'Open in Atom' to context menu (when you right click) in Windows Explorer.
;
; Based on https://github.com/Zren/atom-windows-context-menu. It didn't work
; https://github.com/Zren/atom-windows-context-menu/issues/1.
;
; Save this file to disk with a .reg extension. Replace C:\\Atom\\atom.exe with
; the path to the atom executable on your machine.
@chickenfoot88
chickenfoot88 / index.js
Last active April 8, 2018 17:19
Simple JS timer
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Timer Lesson</title>
<link rel="stylesheet" href="main.css">
</head>
<body>
@chickenfoot88
chickenfoot88 / button.sass
Created March 26, 2018 15:55 — forked from agragregra/button.sass
Button Sass Styles (Universal Starter)
.button
display: inline-block
border: none
color: #fff
text-decoration: none
background-color: $accent
padding: 15px 45px
font-size: 13px
text-transform: uppercase
font-weight: 600
@chickenfoot88
chickenfoot88 / html5boilerplate.jade
Created January 17, 2018 09:13 — forked from xtian/html5boilerplate.jade
HTML5 Boilerplate in jade
!!! 5
html(class='no-js')
head
meta(charset='utf-8')
meta(http-equiv='X-UA-Compatible', content='IE=edge')
title
meta(name='description', content='')
meta(name='viewport', content='width=device-width, initial-scale=1')