This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef H_SDLSIMPLE | |
#define H_SDLSIMPLE | |
#include <SDL2/SDL.h> | |
#include <stdbool.h> | |
#include <stdio.h> | |
// defines | |
typedef struct sdlsimple_events_t { | |
bool quit; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# wordle.tcl | |
set inc_l s | |
set excl_l judgemcbn | |
set inc_pt [list '.la.k' ] | |
set excl_pt [list 's....'] | |
proc include-letters {letters} { | |
set letters_list [split $letters {}] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react' | |
import { observer } from 'mobx-react' | |
import store from './store' | |
let student1 = { | |
id: 'student1', | |
name: 'Ben' | |
} | |
let student2 = { | |
id: 'student2', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { observable, computed } from 'mobx' | |
const store = observable({ | |
students: observable.map(), | |
courses: observable.map(), | |
enrollment: observable.map(), | |
addStudent(student) { | |
if (this.students.has(student.id)) { | |
throw new Error('student already exists') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/********************************************** | |
* | |
* This simple library is used to redirect | |
* functions like printf(), scanf(), putchar() | |
* among other to the UART output on the STM32 | |
* using HAL. | |
* | |
* Credits to the book Mastering STM32 | |
* File by Benjamin Calderon 2017 | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let startArr = [1, 2, 3, 4, 5] | |
let newArr = startArr.filter(n => n > 2) // -> [3, 4, 5] | |
let newStr = "foo bar" | |
let result = newStr.startsWith("foo") // -> true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo chown -R admin:www-data /var/www; | |
sudo find /var/www -type f -exec chmod 664 {} \; | |
sudo find /var/www -type d -exec chmod 775 {} \; | |
sudo find /var/www -type d -exec chmod g+s {} \; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Credits: https://github.com/hexagon5un/AVR-Programming/blob/master/AVR-Programming-Library/macros.h | |
#define BV(bit) (1 << bit) | |
#define set_bit(sfr, bit) (_SFR_BYTE(sfr) |= BV(bit)) // old sbi() | |
#define clear_bit(sfr, bit) (_SFR_BYTE(sfr) &= ~BV(bit)) // old cbi() | |
#define toggle_bit(sfr, bit) (_SFR_BYTE(sfr) ^= BV(bit)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alias nah="git reset --hard && git clean -df" |