Skip to content

Instantly share code, notes, and snippets.

Pharap Pharap

  • Space
Block or report user

Report or block Pharap

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@Pharap
Pharap / CC0.txt
Last active May 21, 2019
Pokitto Serial Example
View CC0.txt
Creative Commons Legal Code
CC0 1.0 Universal
CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE
LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN
ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS
INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES
REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS
PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM
@Pharap
Pharap / Vignere.h
Last active Mar 28, 2019
Vignere Cipher
View Vignere.h
#pragma once
//
// Copyright (C) 2019 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
@Pharap
Pharap / SDLInVS.md
Last active Oct 23, 2018
Steps to use SDL in VS
View SDLInVS.md
  1. VC++ Directories > Include Directories = $(SolutionDir)$(SolutionName)\Include
  2. VC++ Directories > Library Directories = $(SolutionDir)$(SolutionName)\Lib
    • $(SolutionDir)$(SolutionName)\Lib\x64 for x64
    • $(SolutionDir)$(SolutionName)\Lib\x86 for x86
  3. C/C++ > Code Generation > Runtime Library = Multi-threaded DLL (/MD)
  4. Linker > System > SubSystem = Windows (/SUBSYSTEM:WINDOWS)
  5. Linker > Input > Additional Dependencies = SDL2.lib;SDL2main.lib;
@Pharap
Pharap / PokittoLua.cpp
Created Oct 23, 2018
Pokitto + Lua example
View PokittoLua.cpp
#include "PokittoLua.h"
#include <Pokitto.h>
#include <cstdint>
int Pokitto_Display_getWidth(lua_State * state)
{
lua_pushinteger(state, Pokitto::Display::getWidth());
return 1;
@Pharap
Pharap / FuncPtr.cpp
Created Oct 21, 2018
Demonstrates that function pointer dereferencing is equivalent to identity
View FuncPtr.cpp
#include <type_traits>
#include <iostream>
int func(void) { return 42; }
int main(void)
{
auto fp0 = func;
auto fp1 = *func;
auto fp2 = *******func;
@Pharap
Pharap / StackOverflow.cs
Created Oct 13, 2018
Short C# program that crashes at runtime. Good fun.
View StackOverflow.cs
namespace StackOverflowProgram
{
class Program
{
static void Main(string[] args)
{
Main(args);
}
}
}
View NamedParams.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication1
{
class Program
{
public class Base
@Pharap
Pharap / example.cpp
Created Aug 25, 2018
ino vs cpp example
View example.cpp
// cpp files require these includes
// ino files do not
#include <Arduino.h>
#include <Serial.h>
// cpp files require this predeclaration
// ino files do not
void sendMessage(void);
void setup(void)
View BSD3ClauseLicence.txt
Copyright 2018 Pharap
Redistribution and use in source and binary forms, with or
without modification, are permitted provided that the following
conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following disclaimer
@Pharap
Pharap / Program.cs
Created Jul 10, 2018
Generates angles
View Program.cs
using System;
using System.IO;
namespace AngleGenerator
{
class Program
{
static void Main(string[] args)
{
double Tau = Math.PI * 2;
You can’t perform that action at this time.