Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
I',m probably studying...

Leo Caseiro leocaseiro

💭
I',m probably studying...
View GitHub Profile
@leocaseiro
leocaseiro / input.scss
Created Jun 20, 2022
Generated by SassMeister.com.
View input.scss
.game {
$majorsImp: 'Fireplace1', 'Fireplace2', 'CookingHearth1', 'CookingHearth2', 'ClayOven', 'StoneOven', 'Joinery', 'Pottery', 'Basket', 'Well';
@each $mId in $majorsImp {
$i: index($majorsImp, $mId);
.card--#{$mId} {
background-position-x: (($i - 1) % 5) * 100% / 4;
background-position-y: (($i - 1 - ($i - 1) % 5) / 5) * 100%;
}
}
@leocaseiro
leocaseiro / input.scss
Created Jun 20, 2022
Generated by SassMeister.com.
View input.scss
.game {
$majorsImp: 'Fireplace1', 'Fireplace2', 'CookingHearth1', 'CookingHearth2', 'ClayOven', 'StoneOven', 'Joinery', 'Pottery', 'Basket', 'Well';
@each $mId in $majorsImp {
$i: index($majorsImp, $mId);
&[data-id='Major_#{$mId}'] {
.card-icon {
background-position-x: (($i - 1) % 5) * 100% / 4;
background-position-y: (($i - 1 - ($i - 1) % 5) / 5) * 100%;
}
@leocaseiro
leocaseiro / reversi.game.php
Last active May 13, 2022
getPossibleMoves, getBoard, and getTurnedOverDiscs methods for reversi BGA tutorial
View reversi.game.php
class Reversi extends Table
{
//////////////////////////////////////////////////////////////////////////////
//////////// Utility functions (functions used everywhere)
////////////
// Get the list of returned disc when "player" we play at this place ("x", "y"),
// or a void array if no disc is returned (invalid move)
function getTurnedOverDiscs( $x, $y, $player, $board )
View codename-pictures.txt
https://github.com/samdemaeyer/codenames-pictures/raw/master/public/images/cards/card-0.jpg
https://github.com/samdemaeyer/codenames-pictures/raw/master/public/images/cards/card-1.jpg
https://github.com/samdemaeyer/codenames-pictures/raw/master/public/images/cards/card-10.jpg
https://github.com/samdemaeyer/codenames-pictures/raw/master/public/images/cards/card-100.jpg
https://github.com/samdemaeyer/codenames-pictures/raw/master/public/images/cards/card-101.jpg
https://github.com/samdemaeyer/codenames-pictures/raw/master/public/images/cards/card-102.jpg
https://github.com/samdemaeyer/codenames-pictures/raw/master/public/images/cards/card-103.jpg
https://github.com/samdemaeyer/codenames-pictures/raw/master/public/images/cards/card-104.jpg
https://github.com/samdemaeyer/codenames-pictures/raw/master/public/images/cards/card-105.jpg
https://github.com/samdemaeyer/codenames-pictures/raw/master/public/images/cards/card-106.jpg
@leocaseiro
leocaseiro / cloudSettings
Last active Jun 8, 2020
Visua Studio settings sync
View cloudSettings
{"lastUpload":"2020-06-08T01:23:04.722Z","extensionVersion":"v3.4.3"}
@leocaseiro
leocaseiro / slide-toggle-usage.html
Last active Feb 19, 2018
slide-toggle: es6 vanilla javascript with SASS
View slide-toggle-usage.html
<button class="js-slide-toggle__btn">toggle</button>
<div class="js-slide-toggle__content">
Nunc nec neque. In turpis. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Aenean tellus metus, bibendum sed, posuere ac, mattis non, nunc. In auctor lobortis lacus.
Etiam sit amet orci eget eros faucibus tincidunt. Proin faucibus arcu quis ante. Sed aliquam ultrices mauris. Aenean viverra rhoncus pede. Donec interdum, metus et hendrerit aliquet, dolor diam sagittis ligula, eget egestas libero turpis vel mi.
</div>
@leocaseiro
leocaseiro / commit-msg
Last active Aug 16, 2019
Git commit-msg hook to check minimal 10 characters length for git commit message
View commit-msg
#!/usr/bin/env bash
# Hook to make sure that no commit message line is lower then 10 characters
while read line; do
# Skip comments
if [ "${line:0:1}" == "#" ]; then
continue
fi
if [ ${#line} -le 10 ]; then
@leocaseiro
leocaseiro / date-format.pipe.ts
Created May 11, 2017
Angular 4 date-fns Pipe
View date-format.pipe.ts
import { Pipe, PipeTransform } from '@angular/core';
import * as format from 'date-fns/format';
@Pipe({
name: 'dateFnsFormat'
})
export class DateFnsFormatPipe implements PipeTransform {
transform(value, args?) {
return format(value, args);