Skip to content

Instantly share code, notes, and snippets.

@SgtPooki
SgtPooki / scroll.easing.js
Last active April 6, 2023 06:05 — forked from dezinezync/scroll.easing.js
ScrollTo easing
function scrollTo(Y, duration, easingFunction, callback) {
var start = Date.now(),
elem = document.documentElement.scrollTop?document.documentElement:document.body,
from = elem.scrollTop;
if(from === Y) {
callback();
return; /* Prevent scrolling to the Y point if already there */
}
@SgtPooki
SgtPooki / .jscsrc
Created August 25, 2014 17:05
starter .jscsrc file that should be edited prior to use
/**
* .jscsrc blank template with all options. Used to help people quickly create and edit a .jscsrc file for their project.
*
* @author Russell Dempsey <[email protected]>
* @version 1.5.9
*/
{
/**
* Path to load additional rules
* Type: Array
@SgtPooki
SgtPooki / .gitconfig
Last active August 29, 2015 14:04
git config
[user]
name = Russell Dempsey
email = [email protected]
[core]
autocrlf = false
editor = vim
[push]
default = current
@SgtPooki
SgtPooki / stashConflictExample
Created July 3, 2014 12:08
stash conflict example
07:01:38 /var/projects
$ mkdir gitStashConflictExample
07:01:53 /var/projects
$ cd gitStashConflictExample/
07:01:55 /var/projects/gitStashConflictExample
$ git init
Initialized empty Git repository in /var/projects/gitStashConflictExample/.git/
@SgtPooki
SgtPooki / .jshintrc
Last active August 29, 2015 14:03 — forked from haschek/.jshintrc
{
// --------------------------------------------------------------------
// JSHint Configuration, Strict Edition
// --------------------------------------------------------------------
//
// This is a options template for [JSHint][1], using [JSHint example][2]
// and [Ory Band's example][3] as basis and setting config values to
// be most strict:
//
// * set all enforcing options to true
@SgtPooki
SgtPooki / provision.sh
Created June 3, 2014 22:31
nvm / rvm provisioning script
#!/bin/bash
sudo apt-get update
sudo apt-get install python-software-properties
sudo add-apt-repository ppa:git-core/ppa
sudo apt-get update
sudo apt-get install -y git curl python-software-properties libcurl3 libcurl3-gnutls libcurl4-openssl-dev
@SgtPooki
SgtPooki / beep.bat
Last active August 29, 2015 14:01
Create a beep! "beep x" will beep x times, for a max of 10. x defaults to 1.
@echo off
REM loopNum defaults to 1, caps at 10.
REM see https://gist.github.com/SgtPooki/99e12f32a874aa7dd3b2
SET loopNum=1
If not "%~1"=="" (
SET loopNum=%1
)
@SgtPooki
SgtPooki / installNode.sh
Created April 30, 2014 20:02
Script to install node and npm on a new arch linux install
sudo pacman -Syy
sudo pacman -S --noconfirm python2 wget git make gcc vim
sudo mv /usr/bin/python /usr/bin/python-BAK
sudo ln -s /usr/bin/python2 /usr/bin/python
source <(curl -s https://gist.githubusercontent.com/SgtPooki/7667376/raw/node-and-npm-in-30-seconds.sh)
@SgtPooki
SgtPooki / .htaccess
Created March 19, 2014 22:54
remove .php
# Apache Rewrite Rules
<IfModule mod_rewrite.c>
Options +FollowSymLinks
RewriteEngine On
RewriteBase /
#RewriteLog /var/rewrite.log RewriteLogLevel 9
# Redirect to URL without extension. (remove .php)
RewriteCond %{THE_REQUEST} ^[A-Z]+\s.+\.php\sHTTP/.+
RewriteRule ^(.+)\.php $1 [R=301,L]
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir $HOME/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=$HOME/local
make install # ok, fine, this step probably takes more than 30 seconds...
#curl https://npmjs.org/install.sh | sh # this is no longer required