Skip to content

Instantly share code, notes, and snippets.

View OrderAndCh4oS's full-sized avatar
🕰️
Writing code

Sean Cooper OrderAndCh4oS

🕰️
Writing code
View GitHub Profile
@ScottPhillips
ScottPhillips / .htaccess
Created February 2, 2012 04:30
Common .htaccess Redirects
#301 Redirects for .htaccess
#Redirect a single page:
Redirect 301 /pagename.php http://www.domain.com/pagename.html
#Redirect an entire site:
Redirect 301 / http://www.domain.com/
#Redirect an entire site to a sub folder
Redirect 301 / http://www.domain.com/subfolder/

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@ashblue
ashblue / move-point-at-angle.js
Created October 9, 2012 17:12
Move point at an angle
/**
* Moves a vertex at an angle for a specific distance, 0 degrees points up and 180 degrees points down
* @param {array} point Location on a cartesian graph formatted as [x, y]
* @param {number} angle Angle at which a point should move in radians
* @param {number} distance How far should the point move at the given angle in pixels?
* @returns {array} Newly moved point formatted as [x, y]
*/
function movePointAtAngle (point, angle, distance) {
return [
point[0] + (Math.sin(angle) * distance),
@jrencz
jrencz / Entity.php
Last active May 31, 2018 07:38
Generating LiipImagineBundle media URIs for FOSRestBundle Api using JMSSerializerBundle
<?php
namespace Acme\AcmeDemoBundle\Entity;
use JMS\Serializer\Annotation as Serializer;
/**
* Entity
*
* @Serializer\ExclusionPolicy("all")
@jonathonbyrdziak
jonathonbyrdziak / .htaccess
Last active November 29, 2020 03:04
htaccess mod_expires / mod_cache / mod_deflate / mod_headers
# ------------------------------------------------------------------------------
#
# Curtousy of the Magento Support Center
# http://magentosupport.help/what-are-expires-headers-and-how-do-i-implement-them/
#
# ------------------------------------------------------------------------------
# ------------------------------------------------------------------------------
# | Mod Caching via Apache |
@vratiu
vratiu / .bash_aliases
Last active June 21, 2024 10:38
Git shell coloring
# Customize BASH PS1 prompt to show current GIT repository and branch.
# by Mike Stewart - http://MediaDoneRight.com
# SETUP CONSTANTS
# Bunch-o-predefined colors. Makes reading code easier than escape sequences.
# I don't remember where I found this. o_O
# Reset
Color_Off="\[\033[0m\]" # Text Reset
@nikhan
nikhan / twitter.sh
Created January 1, 2016 04:45
twitter ffmpeg
ffmpeg -i test.mov -vcodec libx264 -vf 'scale=640:trunc(ow/a/2)*2' -acodec aac -vb 1024k -minrate 1024k -maxrate 1024k -bufsize 1024k -ar 44100 -strict experimental -r 30 out.mp4
"""
#python 2.x
"""
import numpy as np
import math
import matplotlib.pyplot as plt
class Point:
// by Etienne JACOB
// motion blur template by beesandbombs
// needs opensimplexnoise code in another tab
// --> code here : https://gist.github.com/Bleuje/fce86ef35b66c4a2b6a469b27163591e
int[][] result;
float t, c;
float ease(float p) {