Skip to content

Instantly share code, notes, and snippets.

View pixelpicosean's full-sized avatar
🏠

Sean Bohan pixelpicosean

🏠
View GitHub Profile
@pixelpicosean
pixelpicosean / TODO
Created October 15, 2018 23:31
A simple TODO file to re-produce the file list issue of vscode-todo-plus
Header:
☐ Some tasks here
☐ And something else
Another header:
H2:
☐ some task here
var CreateReactiveNumber = function(initValue, min, max, callback) {
var _value = initValue;
var value = function(newVal) {
if (arguments.length > 0) {
var oldVal = _value;
_value = newVal;
if ((oldVal > min && oldVal < max) !== (newVal > min && newVal < max)) {
callback((newVal > min && newVal < max) ? 'enter' : 'leave', _value);
}
@pixelpicosean
pixelpicosean / ZeldaCamera.gd
Created April 9, 2017 06:17
[Zelda Camera] Zelda style camera script(from Dodgetgo) #tags: Godot
extends Camera2D
export(Vector2) var RoomSize;
export(NodePath) var Target;
export var ScrollSpeed = 2;
var Future_pos = Vector2();
var cam_pos = Vector2(0,0);
var is_translating = false;
func _ready():
body {
color: #212121;
font-family: "Helvetica Neue", "Calibri Light", Roboto, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
letter-spacing: 0.02em;
}
#!/bin/bash
# commit
# date YYYY-mm-dd HH:MM:SS
commit="$1" datecal="$2"
temp_branch="temp-rebasing-branch"
current_branch="$(git rev-parse --abbrev-ref HEAD)"
date_timestamp=$(gdate -d "$datecal" +%s)
date_r=$(gdate -R -d "$datecal")
@pixelpicosean
pixelpicosean / comma-format-number.js
Last active August 29, 2015 14:23
Add comma to numbers
function numberText(number) {
number += '';
var x = number.split('.');
var x1 = x[0];
var x2 = x.length > 1 ? '.' + x[1] : '';
var rgx = /(\d+)(\d{3})/;
while (rgx.test(x1)) {
x1 = x1.replace(rgx, '$1' + ',' + '$2');
}
return x1 + x2;
@pixelpicosean
pixelpicosean / single-canvas.html
Last active August 29, 2015 13:59
Single canvas HTML page(Mobile device capable)
<!doctype html>
<html>
<head>
<title>WebGL 2D Rendering</title>
<meta name="viewport" content="user-scalable=no, width=device-width, initial-scale=1, maximum-scale=1, minimal-ui">
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
<style>
html, body {
background-color: #333;
@pixelpicosean
pixelpicosean / noselectable.css
Created April 14, 2014 07:01
Make canvas elements not selectable
canvas {
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
outline: none;
-webkit-tap-highlight-color: rgba(255, 255, 255, 0);
/* mobile webkit */
@pixelpicosean
pixelpicosean / pixel-scaling.css
Last active January 24, 2020 03:11
Pixel-art scaling on HTML5 canvas (does not work for Chrome)
canvas {
image-rendering: crisp-edges;
image-rendering: -moz-crisp-edges;
image-rendering: -webkit-optimize-contrast;
-ms-interpolation-mode: nearest-neighbor;
}
@pixelpicosean
pixelpicosean / custom_scrollbar.css
Created October 28, 2013 08:30
Customize scrollbar with CSS (WebKit ONLY)
/**
* <div class="scrollbar" id="ex3">
* <div class="content">Example 3</div>
* </div>
*/
.scrollbar {
width: 150px;
height: 300px;
background-color: lightgray;