Skip to content

Instantly share code, notes, and snippets.

View m1ch3lp3r3z's full-sized avatar

Michel Perez m1ch3lp3r3z

  • Mobilerider Networks
  • Florida, United States
  • X @m1ch3lp3r3z
View GitHub Profile
@m1ch3lp3r3z
m1ch3lp3r3z / ttt.php
Last active July 6, 2021 04:15
Tic Tac Toe Attempt 1 h 5 minutes
<?php
class TicTacToe
{
const VALUE_X = "x";
const VALUE_O = "o";
protected $size;
protected $board;
protected $winner;

Keybase proof

I hereby claim:

  • I am m1ch3lp3r3z on github.
  • I am m1ch3lp3r3z (https://keybase.io/m1ch3lp3r3z) on keybase.
  • I have a public key ASAyRNq7NgH-7hb_1rtjJUFK6Pr1GyO6dhQo4T7Exz8JmQo

To claim this, I am signing this object:

@m1ch3lp3r3z
m1ch3lp3r3z / utils.sh
Created January 21, 2016 19:09
Useful commands
# List all cron jobs for all users
for user in $(cut -f1 -d: /etc/passwd); do sudo crontab -u $user -l; done
// Open:
/Applications/Xcode.app/Contents/Developer/usr/libexec/git-core/git-pull
// Replace line 11 & 12 & 207
. git-sh-setup
. git-sh-i18n
. git-parse-remote
// With this:
. /Applications/Xcode.app/Contents/Developer/usr/libexec/git-core/git-sh-setup
@m1ch3lp3r3z
m1ch3lp3r3z / 0_reuse_code.js
Created July 28, 2014 12:29
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
<?php
/**
* PHP Regex to validate a Twitter hashtag
*
* Useful for validating a text input (an HTML form in your CMS or custom application) that must be a valid Twitter hashtag.
* Valid examples: #a, #_, #_1, #_a, #1a, #áéìôü, #123hàsh_täg446
* Invalid examples: #1, ##hashtag, #hash-tag, #hash.tag, #hash tag, #hashtag!, (any hashtag that is more than 140 characters long, hash symbol included)
*
* Regex explanation:
* First, the lookahead assertion (?=.{2,140}$) checks the minimum and max length, as explained here http://stackoverflow.com/a/4223213/1441613
(function(wndw) {
var Browsers, OS, Platform, Versions, browser_name, browser_version, os, platform;
Versions = {
Firefox: /firefox\/([\d\w\.\-]+)/i,
IE: /msie\s([\d\.]+[\d])/i,
Chrome: /chrome\/([\d\w\.\-]+)/i,
Safari: /version\/([\d\w\.\-]+)/i,
Ps3: /([\d\w\.\-]+)\)\s*$/i,
Psp: /([\d\w\.\-]+)\)?\s*$/i
};