Skip to content

Instantly share code, notes, and snippets.

View selvinortiz's full-sized avatar
👋

Selvin Ortiz selvinortiz

👋
View GitHub Profile
@selvinortiz
selvinortiz / AITool.md
Created March 5, 2024 18:31 — forked from localzet/AITool.md
AI Tool Master List
@selvinortiz
selvinortiz / main.rs
Last active November 28, 2022 05:58
Read PNG files as variants into a trait and add those traits to the collection to prepare layers for the next step in generating NFTs
use std::convert::AsRef;
use std::io::Result;
use std::path::{Path, PathBuf};
#[derive(Debug)]
struct Trait {
name: String,
variants: Vec<String>,
}
@selvinortiz
selvinortiz / app.js
Created July 31, 2016 05:39 — forked from sogko/app.js
gulp + expressjs + nodemon + browser-sync
'use strict';
// simple express server
var express = require('express');
var app = express();
var router = express.Router();
app.use(express.static('public'));
app.get('/', function(req, res) {
res.sendfile('./public/index.html');
Verifying that +selvinortiz is my blockchain ID. https://onename.com/selvinortiz
<?php
namespace Craft;
class MyPluginService extends BaseApplicationComponent
{
const DEFAULT_TEMPLATES_PATH = 'path/to/templates/';
/**
* Renders a template in a custom location defined by $path
*
@selvinortiz
selvinortiz / craftplugintesting.md
Last active September 13, 2018 18:23
Unit Testing for Craft Plugins

Unit Testing for Craft Plugins

Writing unit tests for your craft plugin has not been straight forward out of the gate but P&T is taking steps to fully integrate unit testing and have already added the basic necessities to do so.

Assumed Directory Structure


@craft = /path/to/site/craft
@craftTests = @craft/app/tests
@selvinortiz
selvinortiz / craftrecord.php
Last active December 24, 2015 15:29
Craft:Record:getInstance
<?php
namespace Craft;
class Plugin_BaseRecord extends BaseRecord
{
public static function getInstance(BaseModel $model=null)
{
$record = get_called_class();
$record = new $record;
@selvinortiz
selvinortiz / flux.twig
Last active December 20, 2015 02:29
CRAFT:Flux
{% extends "_abstract/master.twig" %}
{% set bodyId = 'flux' %}
{% block content %}
{% set url = 'http://www.selvinortiz.com' %}
{%
set flux = craft.flux
.startOfLine()
.find('http')
.maybe('s')
@selvinortiz
selvinortiz / spamguard.html
Created July 3, 2013 00:22
SpamGuard:Test
{% extends "_abstract/master.twig" %}
{% set title = "Spam Guard" %}
{% set bodyId = "spamguard" %}
{% block content %}
{% if spam is defined %}
{% set email = spam.email %}
{% set author = spam.author %}
{% set content = spam.content %}
@selvinortiz
selvinortiz / env.php
Last active December 18, 2015 18:50
CRAFT:Env
<?php
/**
* @=ENV
*
* @author Selvin Ortiz (http://twitter.com/selvinortiz)
*
* 1. Define the craft path relative to this file
* 2. Define the domain name this site is running under
* 3. Define the ip address that requested this resource
* 4. Define the environment we are working under