Skip to content

Instantly share code, notes, and snippets.

View peppy's full-sized avatar

Dean Herbert peppy

View GitHub Profile
@peppy
peppy / osuStacking.cs
Created August 24, 2011 07:18
osu! stacking algorithm
/* Stacking used in osu! formats v6+. (c) peppy 2011
* Versions previous to 6 had incorrect stacking, but is maintained for scoring purposes.
* For non-osu! clones there should be no problem using the following alogrithm for all format versions.
*/
StackOffset = HitObjectRadius / 10; //ymmv
Vector2 stackVector = new Vector2(StackOffset, StackOffset);
const int STACK_LENIENCE = 3;
@peppy
peppy / gist:1235731
Created September 22, 2011 19:15
osu! easing functions
//used for easing = 1
internal static float easeInVal(float currTime, float start, float end, float duration)
{
return duration == 0 ? start : MathHelper.Lerp(end, start, (float) Math.Pow(1 - currTime/duration, 2));
}
//used for easing = 2
internal static float easeOutVal(float currTime, float start, float end, float duration)
{
return duration == 0 ? start : MathHelper.Lerp(start, end, (float) Math.Pow(currTime/duration, 2));
@peppy
peppy / save.asp
Created March 21, 2012 05:35
testing
Set db = DB_open(C_CMS_Database, C_CMS_Username, C_CMS_Password, C_CMS_Server)
@peppy
peppy / a.js
Created March 21, 2012 11:49
A J A X
function addToBin(itemId, homepage)
{
$("html").append("<iframe style='display:none' src='" + baseScriptPath + "bin_add.asp?p=" + itemId + "'></iframe>");
}
<!-- dean -->
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js"></script>
<script type="text/javascript" src="http://code.jquery.com/ui/1.8.18/jquery-ui.min.js"></script>
<script type="text/javascript" src="http://cms.ebooks.com/admin/d2/trudaliser2.user.js"></script>
<!-- /dean -->
internal bool IsRetarded()
{
if (sliderCurveSmoothLines == null || cumulativeLengths == null)
return false;
float legalDistance = HitObjectManager.HitObjectRadius * 1.0f;
float scanDistance = HitObjectManager.HitObjectRadius * 4.0f;
for (int x = 0; x < sliderCurveSmoothLines.Count; x++)
{
@peppy
peppy / snippet.txt
Created March 29, 2012 07:45
xtrabackup assertion fail
xtrabackup: tables regcomp(osu.phpbb_users): Success
xtrabackup version 1.6.5 for Percona Server 5.1.59 unknown-linux-gnu (x86_64) (revision id: undefined)
xtrabackup: uses posix_fadvise().
xtrabackup: cd to /var/lib/mysql
xtrabackup: Target instance is assumed as followings.
xtrabackup: innodb_data_home_dir = ./
xtrabackup: innodb_data_file_path = ibdata1:10M:autoextend
xtrabackup: innodb_log_group_home_dir = ./
xtrabackup: innodb_log_files_in_group = 2
@peppy
peppy / aprilfoold2012.htm
Created April 1, 2012 15:26
osu! site FL/HD mod implementation (April Fools' 2012)
<!-- April Fools' 2012 <3 peppy -->
<!-- Concept courtesey of SapphireGhost -->
<style>
.flashlight {
top: 0;
left: 0;
width: 100%;
height: 100%;
opacity: 0;
background: url('/images/flashlight.png');
@peppy
peppy / snippet.txt
Created April 8, 2012 15:28
crash1
Process: Sublime Text 2 [92213]
Path: /Applications/Sublime Text 2.app/Contents/MacOS/Sublime Text 2
Identifier: com.sublimetext.2
Version: Beta, Build 2193 (2193)
Code Type: X86-64 (Native)
Parent Process: launchd [256]
Date/Time: 2012-04-08 23:24:54.348 +0800
OS Version: Mac OS X 10.7.3 (11D50)
Report Version: 9
@peppy
peppy / snippet.txt
Created April 8, 2012 15:29
crash2
Process: Sublime Text 2 [96012]
Path: /Applications/Sublime Text 2.app/Contents/MacOS/Sublime Text 2
Identifier: com.sublimetext.2
Version: Beta, Build 2193 (2193)
Code Type: X86-64 (Native)
Parent Process: launchd [256]
Date/Time: 2012-04-08 23:27:45.128 +0800
OS Version: Mac OS X 10.7.3 (11D50)
Report Version: 9