Skip to content

Instantly share code, notes, and snippets.

View leocaseiro's full-sized avatar
💭
I',m probably studying...

Leo Caseiro leocaseiro

💭
I',m probably studying...
View GitHub Profile
@leocaseiro
leocaseiro / index.js
Created March 22, 2023 11:13
show link to Github Pages source at gh-pages via tampermonkey
// ==UserScript==
// @name Github Pages Source
// @version 1.4.0
// @description Easily go to GitHub Pages' source repository
// @author kidonng
// @namespace https://github.com/kidonng/cherry
// @match http*://*.github.io/*
// ==/UserScript==
;(() => {
@leocaseiro
leocaseiro / index.html
Created March 15, 2023 07:25
Firebug Lite
<script
type="text/javascript"
src="https://cdnjs.cloudflare.com/ajax/libs/firebug-lite/1.4.0/firebug-lite.js#startOpened=true,disableWhenFirebugActive=false"
>
</script>
@leocaseiro
leocaseiro / validate_currency.php
Created February 19, 2015 23:16
RegEx Currency PHP $1,000,000.00
<?php
/**
* Check if value is currency $value
*
* Pass on:
* 1,000,000.00
* 10,000.00
* 1,000.00
* 100.00
@leocaseiro
leocaseiro / input.scss
Created June 20, 2022 08:38
Generated by SassMeister.com.
.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 June 20, 2022 08:35
Generated by SassMeister.com.
.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 13:34
getPossibleMoves, getBoard, and getTurnedOverDiscs methods for reversi BGA tutorial
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 )
@leocaseiro
leocaseiro / .htaccess
Last active February 23, 2022 03:59
Angular html5Mode apache working in a subdirectory /app using ngRoute
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^(.*) /app/index.html [NC,L]
</IfModule>
@leocaseiro
leocaseiro / class-wp-cpt-plugin-base-singleton.php
Created August 20, 2014 01:23
WordPress Plugin with Custom Post and Metabox using Singleton
<?php
if ( !class_exists('Primped_Base_Singleton') ):
abstract class Primped_Base_Singleton {
/**
* Parsed options for module
*
* @var array