Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

Mika Mulperi Lakanen Mulperi

🎯
Focusing
Block or report user

Report or block Mulperi

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
@Mulperi
Mulperi / sampath.txt
Created Jan 20, 2020
AWS SAM CLI Path error
View sampath.txt
If you have installed SAM CLI via homebrew but command 'sam' is not recognized.
type: cd && nano .bashrc
Add this line to your .bashrc file:
export PATH="/home/linuxbrew/.linuxbrew/Cellar/aws-sam-cli/0.40.0/bin:$PATH"
View keybase.md

Keybase proof

I hereby claim:

  • I am mulperi on github.
  • I am mulperi (https://keybase.io/mulperi) on keybase.
  • I have a public key ASDU6LkVEUFMxDGIdofTqmeJ8HhrJNGgaO8FZK3iBrCvswo

To claim this, I am signing this object:

View mbp linux f keys
echo 2 > /sys/module/hid_apple/parameters/fnmode
@Mulperi
Mulperi / disable_mouseacceleration.txt
Created Jun 6, 2019
Disable mouse acceleration Linux centOS Gnome
View disable_mouseacceleration.txt
sudo nano /usr/share/X11/xorg.conf.d/50-mouse-acceleration.conf
# paste the following
Section "InputClass"
Identifier "My Mouse"
MatchIsPointer "yes"
Option "AccelerationProfile" "-1"
Option "AccelerationScheme" "none"
Option "AccelSpeed" "-1"
View Program.cs
using System;
public class Program
{
public static double GetAverage(double[] arr)
{
double sum = 0;
double amount = 0;
for (int i = 0; i < arr.Length; i++)
{
@Mulperi
Mulperi / box2d_test.md
Created Apr 4, 2019
Xcode and Box2D setup
View box2d_test.md

Xcode and Box2D setup

  1. Download and unzip the Box2D source code from https://github.com/erincatto/Box2D

  2. Install premake5 from https://premake.github.io/download.html and move the executable to /usr/bin/ so it is in your PATH.

  3. Go to the unzipped folder and build the library from command line with premake xcode4

  4. From resulting Build folder, get libBox2D.a which is the library archive file and the whole Box2D folder that has the header files and place them to your Xcode project folder so that the dependencies folder is one level up from the main.cpp and other source files.

@Mulperi
Mulperi / class_inheritance.cpp
Created Apr 1, 2019
C++ classes and inheritance
View class_inheritance.cpp
// Example program
#include <iostream>
#include <string>
class Human {
std::string name;
public: // Without this, methods are set private and cannot be accessed outside the class
Human(std::string name = "Anonymous"){this->setName(name);}
std::string getName() {return this->name;};
void setName(std::string name) {this->name = name;};
@Mulperi
Mulperi / foreach.cpp
Created Mar 25, 2019
C++ for each loop.
View foreach.cpp
#include <iostream>
#include <string>
int main()
{
int arr[]{ 1, 2, 3, 4 };
for (int i : arr)
std::cout << i << std::endl;
}
@Mulperi
Mulperi / class.cpp
Last active Mar 25, 2019
C++ class constructor with default value
View class.cpp
#include <iostream>
#include <string>
class Person
{
public:
std::string name;
Person(std::string name = "anonymous") // Default value for name attribute
{
@Mulperi
Mulperi / template.cpp
Created Mar 25, 2019
c++ template function
View template.cpp
#include <iostream>
#include <string>
template <class T>
T getMax(T a, T b)
{
return a > b ? a : b;
}
int main()
You can’t perform that action at this time.