Skip to content

Instantly share code, notes, and snippets.

View Luchanso's full-sized avatar
🦄
Easy breezy

Oleg Luchanso

🦄
Easy breezy
View GitHub Profile
@Luchanso
Luchanso / Dockerfile
Created November 3, 2024 09:32 — forked from kjlape/Dockerfile
Self-Hosted Docker Registry with Kamal (as of version 2.2.2)
FROM registry:2
@Luchanso
Luchanso / grafana_telegram_bot.md
Created August 22, 2021 09:44 — forked from ilap/grafana_telegram_bot.md
Grafana Telegram Alert

Config Telegrambot for grafana's alerts.

1. Create bot

Open Telegram and search for @BotFather user and message them the following:

You
/newbot 

BotFather
WARNING: the code that follows will make you cry; a safety pig is provided below for your benefit.
_
_._ _..._ .-', _.._(`))
'-. ` ' /-._.-' ',/
) \ '.
/ _ _ | \
| a a / |
\ .-. ;
'-('' ).-' ,' ;

Phaser Cheatsheet

This is the content from the original Phaser cheatsheet, the site of which went down. I'm editing outdated information as I come across it.

Starting a new game

Reference: http://docs.phaser.io/Phaser.Game.html#Game

var game = new Phaser.Game(width, height, renderer, "parent");
//All parameters are optional but you usually want to set width and height
//Remember that the game object inherits many properties and methods!
@Luchanso
Luchanso / gh-pages-deploy.md
Created May 6, 2016 06:50 — forked from cobyism/gh-pages-deploy.md
Deploy to `gh-pages` from a `dist` folder on the master branch. Useful for use with [yeoman](http://yeoman.io).

Deploying a subfolder to GitHub Pages

Sometimes you want to have a subdirectory on the master branch be the root directory of a repository’s gh-pages branch. This is useful for things like sites developed with Yeoman, or if you have a Jekyll site contained in the master branch alongside the rest of your code.

For the sake of this example, let’s pretend the subfolder containing your site is named dist.

Step 1

Remove the dist directory from the project’s .gitignore file (it’s ignored by default by Yeoman).

@Luchanso
Luchanso / Copy.hx
Created April 4, 2016 14:28 — forked from Asmageddon/Copy.hx
Deep copy of anything for Haxe
package com.asmoprime.utils;
/**
* ...
* @author Asmageddon
*/
class Copy {
/**
* Deep copy of anything using reflection (so don't hope for much performance)
**/
@Luchanso
Luchanso / main.js
Last active February 21, 2016 14:47 — forked from anonymous/main.js
Найти ошибку в коде
var database = {
myString: "hello world",
myNumber: 12
}
function getFieldFromDB(callback, field) {
setTimeout(function() {
if (database == field) {
callback(null, database[field]);
} else {
@Luchanso
Luchanso / EventEmitter.coffee
Created December 12, 2015 22:42 — forked from yocontra/EventEmitter.coffee
Tiny browser/node EventEmitter implementation in coffeescript
class EventEmitter
constructor: ->
@events = {}
emit: (event, args...) ->
return false unless @events[event]
listener args... for listener in @events[event]
return true
addListener: (event, listener) ->
Function::define = (prop, desc) ->
Object.defineProperty @prototype, prop, desc
class Person
constructor: (@firstName, @lastName) ->
@define 'fullName',
get: -> "#{@firstName} #{@lastName}"
set: (name) -> [@firstName, @lastName] = name.split ' '
$(window).on 'scroll':->
console.log($(window).scrollTop())