Skip to content

Instantly share code, notes, and snippets.

Avatar
⌨️
Keyboard > mouse

Yuri Santos Yrds

⌨️
Keyboard > mouse
View GitHub Profile
@Yrds
Yrds / main.cpp
Created Aug 27, 2021
Hello world X11 modern c++
View main.cpp
#include <X11/Xlib.h>
#include <unistd.h>
#include <memory>
#include <functional>
int main() {
//initialize Display connection with a smart pointer
auto dpy = std::unique_ptr<Display, std::function<void(Display*)>>(
XOpenDisplay(0), XFlush);
View bluetoothctl.txt
Agent registered
[CHG] Controller 00:1A:7D:DA:71:13 Pairable: yes
[bluetooth]# default-agent
Default agent request successful
[bluetooth]# agent on
Agent is already registered
[bluetooth]# power on
Changing power on succeeded
[CHG] Controller 00:1A:7D:DA:71:13 Powered: yes
[bluetooth]# scan on
View gamepadviewer_ds4_linux_mappings
https://gamepadviewer.com/?p=1&s=5&map={%22mapping%22%3A[{%22targetType%22%3A%22buttons%22%2C%22target%22%3A%222%22%2C%22disabled%22%3Afalse%2C%22choiceType%22%3A%22buttons%22%2C%22choice%22%3A%223%22}%2C{%22targetType%22%3A%22buttons%22%2C%22target%22%3A%223%22%2C%22disabled%22%3Afalse%2C%22choiceType%22%3A%22buttons%22%2C%22choice%22%3A%222%22}%2C{%22targetType%22%3A%22buttons%22%2C%22target%22%3A%2213%22%2C%22disabled%22%3Afalse%2C%22choiceType%22%3A%22axes%22%2C%22choice%22%3A%227%22%2C%22choiceOperand%22%3A%22%2B%22}%2C{%22targetType%22%3A%22buttons%22%2C%22target%22%3A%2214%22%2C%22disabled%22%3Afalse%2C%22choiceType%22%3A%22axes%22%2C%22choice%22%3A%226%22%2C%22choiceOperand%22%3A%22-%22}%2C{%22targetType%22%3A%22buttons%22%2C%22target%22%3A%2215%22%2C%22disabled%22%3Afalse%2C%22choiceType%22%3A%22axes%22%2C%22choice%22%3A%226%22%2C%22choiceOperand%22%3A%22%2B%22}%2C{%22targetType%22%3A%22axes%22%2C%22target%22%3A%222%22%2C%22disabled%22%3Afalse%2C%22choiceType%22%3A%22%22%2C%22positive%22%3A{%22choice
View 01_filter_example.js
const vect = [1, 2, 3, 4, 5, 6, 7, 8];
const evenNumbers = vect.filter(number => number % 2 == 0);
console.log(evenNumbers); //[2, 4, 6, 8]
View 01_find_example.js
const vect = [1, 2, 3, 4, 5, 6, 7, 8];
const numberSix = vect.find(number => number == 6);
console.log(numberSix); //6
@Yrds
Yrds / 01_map_example.js
Last active May 21, 2020
Comparing C++ Array iteration with Javascript
View 01_map_example.js
const vect = [1,2,3,4,5];
const newVect = vect.map(number => number + 1); //Sum all elements by 1
console.log(newVect); // [2,3,4,5,6]
View 01_reduce_example.js
const vect = ['h','e','l','l','o',' ','w','o','r','l','d'];
const newString = vect.reduce((acc, character) => acc.concat(character));
console.log(newString); //hello world
View 1_forEach_example.js
const vect = [1,2,3,4,5];
vect.forEach( vect => console.log(vect));
View PlayerController.cs
//Author: Yuri Santos<yrds96@protonmail.com>
//Description this is an example of how to controll gameobjects through the touch controlls
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
enum TouchGesture {
Tap,
SwipeLeft,
SwipeRight,
@Yrds
Yrds / dabblet.css
Created Apr 9, 2019
The first commented line is your dabblet’s title
View dabblet.css
/**
* The first commented line is your dabblet’s title
*/
background: #f06;
background: linear-gradient(45deg, #f06, yellow);
min-height: 100%;