Skip to content

Instantly share code, notes, and snippets.

View Rican7's full-sized avatar
😮
My dotfiles just keep getting better... and its been OVER 10 YEARS NOW! ⌚😮🤯

Trevor N. Suarez Rican7

😮
My dotfiles just keep getting better... and its been OVER 10 YEARS NOW! ⌚😮🤯
View GitHub Profile
@Rican7
Rican7 / oop-improved-dart-version-of-codecademy-battleship.dart
Last active December 28, 2015 09:49
This is an Object Oriented rewrite of my already rewritten Dart battleship game. I wanted to see how some of the OOP magic features worked. Very nice. Original, more functional approach: https://gist.github.com/Rican7/7480097
import "dart:math";
import "dart:io";
/// Represent a mark on a board
class Mark extends Point<int> {
// Properties
bool _checked = false;
String _representation;
<?php
// Set the THINGS!!!!
$endpoint = 'http://colorapi.paramore.s2.paramoreredd.com/color-queue';
$color_id = 5; // Purple???
// Create the curl
$curl = curl_init();
// Set some options
@Rican7
Rican7 / php-build.bash
Created December 30, 2013 17:47
How to build PHP from source for testing/working on core
git checkout PHP-M.m # Replace M.m with the Major.minor versions (ex: PHP-5.4)
./buildconf --enable-maintainer-mode
./configure --prefix=/usr/local --enable-opcache=no --disable-all
make
make test
@Rican7
Rican7 / getting-tuple-like-params.php
Created January 15, 2014 22:58
In PHP there are multiple ways to get multiple return values in a "tuple-like" style. This GIST explores a few ways of doing so.
<?php
function return_me_data_pls() {
$params_to_return = array(
'count' => range(1,10),
'sum' => array_sum(range(1,10))
);
return $params_to_return;
}
@Rican7
Rican7 / private-property-access-2.php
Created February 4, 2014 00:09
This is a quick demonstration to show how PHP classes can access other classes/sub-classes private properties.
<?php
class Doge
{
private $name;
public function __construct($name)
{
$this->name = $name;
@Rican7
Rican7 / go-version-of-codecademy-battleship.go
Created May 23, 2014 19:06
A Go(lang) translation of an old Codecademy project originally used to learn Python. Original Python version: https://gist.github.com/Rican7/5941418
package main
import (
"fmt"
"math/rand"
"strings"
"time"
)
// Default configuration
@Rican7
Rican7 / oop-improved-go-version-of-codecademy-battleship.go
Created May 29, 2014 05:08
This is an "Object Oriented" rewrite of my already rewritten Go(lang) battleship game. I wanted to see how the OOP design worked in Go. Its different. Original, more functional approach: https://gist.github.com/Rican7/fac67bb68672be09678e
package main
import (
"bytes"
"fmt"
"math/rand"
"strings"
"time"
)
@Rican7
Rican7 / steez
Created December 16, 2014 20:59
The definition of steez.
*steez* (noun) \stˈēz\ - The state representing a particular style that is presented with an ostensible ease; style with ease.
> That backside air had some serious steez.
> Woah, that new design is just oozing steez.
*steezy* (adjective) \stˈēzē\ - Performed or presented with style while showing an apparent ease.
> That Stale Sandbech guy makes everything look steezy.
> I've got that trick down now, but I really gotta work on making it steezy.
@Rican7
Rican7 / gifsicle-optimize.sh
Last active September 14, 2023 08:23
Optimize a GIF for smaller size using Gifsicle
#/usr/bin/env bash
#
# Gifsicle: http://www.lcdf.org/gifsicle/man.html
#
# Use `seq` to create a list sequence of integers, skipping every even number
# `seq -f "#%g" 0 2 213`
gifsicle --unoptimize image.gif | gifsicle --dither --colors 48 --resize-fit-width 512 -O2 `seq -f "#%g" 0 2 213` -o image.optimized.gif
@Rican7
Rican7 / log-request.php
Last active August 29, 2015 14:26
PHP HTTP Request Dumper
<?php
ini_set('error_reporting', E_ALL);
ini_set('display_errors', 1);
ini_set('log_errors', 1);
date_default_timezone_set('UTC');
const LOG_PATH = '/var/log/debug/request-dump.log';