Skip to content

Instantly share code, notes, and snippets.

Avatar
🎓
Studying

Alex Solomaha CyanoFresh

🎓
Studying
View GitHub Profile
View JSON_parser.c
/*
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:
View WebhookController.php
<?php
namespace app\controllers;
use Yii;
use yii\web\BadRequestHttpException;
use yii\web\Controller;
/**
* Class WebhookController
@CyanoFresh
CyanoFresh / README.md
Last active Jan 13, 2020
Working ESP32 platformio on FreeBSD (fix toolchain-extensa32)
View README.md

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.

View FullyFeatured-ESP8266.ino
#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 / getSteamDeviceID.php
Last active May 15, 2019
Generate Steam DeviceID by SteamID for accepting mobile confirmations
View getSteamDeviceID.php
<?php
/**
* Generate device id by steamid
* Usage: getDeviceID('steamid');
*
* @param string $steamid SHOULD BE STRING
* @return string
*/
function getDeviceID($steamid) {
$sha1 = sha1($steamid);
@CyanoFresh
CyanoFresh / build_NodeMCU_firmware.bat
Last active May 1, 2017
Build nodemcu firmware on windows
View build_NodeMCU_firmware.bat
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 / simple_i18n.js
Created Jan 17, 2017
JS Simple i18n key => value
View simple_i18n.js
// Array with translations
var translations = {
'first': 'Hello, {{name}}!'
};
function t(key, values) {
var str = translations[key];
if (!values) {
return str;