Skip to content

Instantly share code, notes, and snippets.

View CyanoFresh's full-sized avatar
🎓
Studying

Alex Solomaha CyanoFresh

🎓
Studying
View GitHub Profile
@CyanoFresh
CyanoFresh / simple_i18n.js
Created January 17, 2017 14:13
JS Simple i18n key => value
// Array with translations
var translations = {
'first': 'Hello, {{name}}!'
};
function t(key, values) {
var str = translations[key];
if (!values) {
return str;
@CyanoFresh
CyanoFresh / build_NodeMCU_firmware.bat
Last active May 1, 2017 17:20
Build nodemcu firmware on windows
docker run --rm -it -v //c/Users/CyanoFresh/nodemcu-firmware:/opt/nodemcu-firmware marcelstoer/nodemcu-build
docker run -e "INTEGER_ONLY=1" --rm -it -v //c/Users/CyanoFresh/nodemcu-firmware:/opt/nodemcu-firmware marcelstoer/nodemcu-build
docker run -e "FLOAT_ONLY=1" --rm -it -v //c/Users/CyanoFresh/nodemcu-firmware:/opt/nodemcu-firmware marcelstoer/nodemcu-build
@CyanoFresh
CyanoFresh / getSteamDeviceID.php
Last active May 15, 2019 22:13
Generate Steam DeviceID by SteamID for accepting mobile confirmations
<?php
/**
* Generate device id by steamid
* Usage: getDeviceID('steamid');
*
* @param string $steamid SHOULD BE STRING
* @return string
*/
function getDeviceID($steamid) {
$sha1 = sha1($steamid);
#include <ESP8266WiFi.h>
#include <Ticker.h>
#include <AsyncMqttClient.h>
#include "SSD1306Wire.h"
#define WIFI_SSID "//"
#define WIFI_PASSWORD "//"
#define MQTT_HOST "test.mosquitto.org"
#define MQTT_PORT 1883
@CyanoFresh
CyanoFresh / README.md
Last active January 13, 2020 16:11
Working ESP32 platformio on FreeBSD (fix toolchain-extensa32)

This is guide to enable support for ESP32 platformio on FreeBSD.

If you have these error messages:

Processing test32 (board: esp32dev; framework: arduino; platform: espressif32)
------------------------------------------------------------------------------------------------------------------------------------
PackageManager: Installing toolchain-xtensa32 @ ~2.50200.0
Error: Could not find a version that satisfies the requirement '~2.50200.0' for your system 'freebsd_amd64'

then this guide is for you.

@CyanoFresh
CyanoFresh / JSON_parser.c
Created April 13, 2021 22:39
CS GO JSON PARSER
/*
Copyright (c) 2005 JSON.org
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@CyanoFresh
CyanoFresh / WebhookController.php
Last active April 23, 2022 19:59
Auto pull for Yii2
<?php
namespace app\controllers;
use Yii;
use yii\web\BadRequestHttpException;
use yii\web\Controller;
/**
* Class WebhookController