Skip to content

Instantly share code, notes, and snippets.

View andrewrcollins's full-sized avatar

Andrew Collins andrewrcollins

View GitHub Profile
// code updates are now there:
// https://github.com/Bleuje/processing-animations-code/blob/main/code/digitsspiral/digitsspiral.pde
// Processing code by Etienne JACOB
// motion blur template by beesandbombs
// needs opensimplexnoise code in another tab
// --> code here : https://gist.github.com/Bleuje/fce86ef35b66c4a2b6a469b27163591e
// See the license information at the end of this file.
// View the rendered result at: https://bleuje.com/gifanimationsite/single/digitsspiral/
@bobbybouwmann
bobbybouwmann / User.php
Last active May 31, 2024 03:04
Laravel Absolute vs Relative Dates with Carbon
<?php
namespace App;
use Carbon\Carbon;
use Illuminate\Database\Eloquent\Model;
class User extends Model
{
/**
@noelboss
noelboss / git-deployment.md
Last active October 12, 2024 16:09
Simple automated GIT Deployment using Hooks

Simple automated GIT Deployment using GIT Hooks

Here are the simple steps needed to create a deployment from your local GIT repository to a server based on this in-depth tutorial.

How it works

You are developing in a working-copy on your local machine, lets say on the master branch. Most of the time, people would push code to a remote server like github.com or gitlab.com and pull or export it to a production server. Or you use a service like deepl.io to act upon a Web-Hook that's triggered that service.

Contributing

When contributing to this repository, please first discuss the change you wish to make via issue, email, or any other method with the owners of this repository before making a change.

Please note we have a code of conduct, please follow it in all your interactions with the project.

Pull Request Process

  1. Ensure any install or build dependencies are removed before the end of the layer when doing a
@PurpleBooth
PurpleBooth / README-Template.md
Last active November 13, 2024 22:21
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@Samuel-Retter
Samuel-Retter / SteinerTreeFinder.py
Last active April 28, 2020 00:23
An iterative heuristic which attempts to fit a minimal Steiner tree (http://en.wikipedia.org/wiki/Steiner_tree_problem) to a given set of points. I provided links to images of some results in a comment.
__author__ = 'Samuel'
import random
import math
from itertools import combinations
import numpy as np
import pylab as pl
from matplotlib import collections as mc
from math import sin, cos, pi, factorial
import matplotlib.pyplot as plt
@h4cc
h4cc / satis_install.sh
Last active February 13, 2024 16:39
Guide to install a satis server for composer. It can mirror packages and create a index for own packages.
# Install a Webserver
apt-get -y install apache2
# Target docroot to /home/satis/web/
# Install PHP5 CLI and needed programs.
apt-get -y install php5-cli php5-curl php5-json git wget
# Add a specifix user for our task
adduser satis
@nkcmr
nkcmr / hsl2hex.php
Created December 11, 2012 14:51
HSL to HEX triplet algorithm
<?php
function HSL2HEX($h,$s,$l){
function hue2rgb($v1, $v2, $vH){
if($vH<0) $vH += 1;
if($vH>1) $vH -= 1;
if((6*$vH)<1) return $v1+($v2-$v1)*6*$vH;
if((2*$vH)<1) return $v2;
if((3*$vH)<2) return $v1+($v2-$v1)*((2/3)-$vH)*6;
return $v1;
@abbotto
abbotto / dominant_color.php
Created October 26, 2012 16:03
Get The Dominant Color Of Any Image.
<?
// Point the script to an image and get its dominant color.
$i = imagecreatefromjpeg("image.jpg");
for ($x=0;$x<imagesx($i);$x++) {
for ($y=0;$y<imagesy($i);$y++) {
$rgb = imagecolorat($i,$x,$y);
$r = ($rgb >> 16) & 0xFF;
$g = ($rgb >> & 0xFF;
@wayneashleyberry
wayneashleyberry / color.php
Created October 17, 2012 14:06
php color manipulation
<?php
function hex2rgb( $col ) {
if ( $col[0] == '#' ) {
$col = substr( $col, 1 );
}
if (strlen( $col ) == 6) {
list( $r, $g, $b ) = array( $col[0] . $col[1], $col[2] . $col[3], $col[4] . $col[5] );
} elseif (strlen( $col ) == 3) {
list( $r, $g, $b ) = array( $col[0] . $col[0], $col[1] . $col[1], $col[2] . $col[2] );