Skip to content

Instantly share code, notes, and snippets.

View Pharap's full-sized avatar
🇺🇦
Путин - клептократический тиран

Pharap Pharap

🇺🇦
Путин - клептократический тиран
  • 12:33 (UTC +01:00)
View GitHub Profile
@Pharap
Pharap / CapeAltDecrypt.h
Last active January 11, 2018 22:12
Single pass cape encrypt and decrypt
void decrypt(char *source, char *destination, uint16_t length)
{
length = length - 1;
auto saltedKey = (salt ^ _reduced_key);
auto b = length ^ saltedKey;
uint8_t iv = source[length] ^ length ^ _key[b % _key_length];
auto ivSaltedKey = iv ^ saltedKey;
@Pharap
Pharap / roundFixedHalfToEven.h
Created January 21, 2018 21:38
Simple roundFixedHalfToEven implementation compatible with my FixedPoints library
/*
Copyright (C) 2018 Pharap (@Pharap)
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
@Pharap
Pharap / RandomUtils.h
Last active January 29, 2018 16:58
Arduboy specific random number utility example
/*
Copyright (C) 2018 Pharap (@Pharap)
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
@Pharap
Pharap / PokittoWavePlayerLog.txt
Created March 22, 2018 22:27
Pokitto Wave Player Info
-------------- Build: WavePlayer in PokittoEmBitz ---------------
Compiling: Examples\WavePlayer\main.cpp
Compiling: Examples\WavePlayer\wave_player.cpp
Compiling: Pokitto\mbed-pokitto\common\assert.c
Compiling: Pokitto\mbed-pokitto\common\board.c
Compiling: Pokitto\mbed-pokitto\common\BusIn.cpp
Compiling: Pokitto\mbed-pokitto\common\BusInOut.cpp
Compiling: Pokitto\mbed-pokitto\common\BusOut.cpp
@Pharap
Pharap / CEOV13.ino
Last active April 21, 2018 19:37 — forked from WrinklyWink/CEOV13.ino
Reduced the size from (10440/1373) to (9710/1337)
//A brain enhancer to conquer random
//special thanks to
#include <Arduboy2.h>
//#include "autopowerdown.h"
Arduboy2 arduboy;
enum class GameState : uint8_t
{
MainMenu,
@Pharap
Pharap / sslKeyExchange.c
Created May 26, 2018 11:19
Apple's infamous goto fail; code
/*
* Copyright (c) 1999-2001,2005-2012 Apple Inc. All Rights Reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this
@Pharap
Pharap / DeltaTime.ino
Created June 3, 2018 15:19
A demonstration of delta timing on Arduboy
#include <Arduboy2.h>
Arduboy2 arduboy;
unsigned long previousTime = 0;
uint8_t frameRate = 60;
void setup()
{
arduboy.begin();
@Pharap
Pharap / Demo.ino
Created June 14, 2018 17:35
Space demo for Neko29100
#include <Arduboy2.h>
// You'll probably want to replace this with a separate image of the rocket
// and the actual title when you know how
const uint8_t TitleScreenImage[] PROGMEM =
{
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC
@Pharap
Pharap / Pharap.clang-format
Created July 4, 2018 05:14
A .clang-format to follow my personal preferred coding style
#
# Copyright (C) 2018 Pharap (@Pharap)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
@Pharap
Pharap / Program.cs
Created July 10, 2018 04:22
Generates angles
using System;
using System.IO;
namespace AngleGenerator
{
class Program
{
static void Main(string[] args)
{
double Tau = Math.PI * 2;