Skip to content

Instantly share code, notes, and snippets.

View SabrinaMarkon's full-sized avatar
🎯
Focusing

Sabrina Markon SabrinaMarkon

🎯
Focusing
View GitHub Profile
#add 'node_modules' to .gitignore file
git rm -r --cached node_modules
git commit -m 'Remove the now ignored directory node_modules'
git push origin master
@SabrinaMarkon
SabrinaMarkon / php-array-left-rotation.php
Last active December 24, 2018 07:15
PHP arrays - rotate array items left d times without using built-in array_pop, array_shift. Uses array_values so times out HackerRank challenge.
<?php
// array to rotate
$a = [1,2,3,4,5];
// the number of left rotations
$d = 4;
// we want 5,1,2,3,4 as the end result
@SabrinaMarkon
SabrinaMarkon / php-array-hackerrank-left-rotation-no-timeout.php
Created December 24, 2018 07:14
PHP array left rotation without shifts or sorts. Doesn't cause timeout on HackerRank left rotation challenge.
<?php
/*
NOTES: If $newa is not pre-filled, the function will fail
because the keys will be added out of numerical order, and also, we can't
use ksort here because the test times out for large input arrays if we
do sorts or shifts of any kind.
i.e. $newa[0] might not be in the first spot of the array for instance.
Pre-filling the $newa array makes sure that the keys are 0-($n-1) in order.
@SabrinaMarkon
SabrinaMarkon / index.html
Last active March 23, 2019 04:22
Three.js Black Hole and Function Grapher - https://jsbin.com/fofumun
<!DOCTYPE html>
<html>
<head>
<!--<script src="https://getfirebug.com/firebug-lite-debug.js"></script>-->
<meta name="description" content="Three.js Black Hole and Function Grapher" />
<meta charset="utf-8" />
<title>Three.js Black Hole and Function Grapher</title>
<style>
#container {
@SabrinaMarkon
SabrinaMarkon / index.html
Last active March 23, 2019 04:36
Three.js My Pink Doughnuts (Torus) - https://jsbin.com/dunuzuc
<!DOCTYPE html>
<html>
<head>
<!--<script src="https://getfirebug.com/firebug-lite-debug.js"></script>-->
<meta name="description" content="Three.js My Pink Doughnuts" />
<meta charset="utf-8" />
<title>Three.js My Pink Doughnuts</title>
<style>
#container {
background: #000000;
@SabrinaMarkon
SabrinaMarkon / index.html
Last active March 23, 2019 04:30
Three.js Square Transformations - https://jsbin.com/lizorep
<!DOCTYPE html>
<html>
<head>
<!-- <script type="text/javascript" src="https://getfirebug.com/firebug-lite-debug.js"></script> -->
<meta name="description" content="Three.js Square Transformations" />
<meta charset="utf-8" />
<style>
#container {
background: #000000;
width: 100%;
@SabrinaMarkon
SabrinaMarkon / index.html
Last active March 23, 2019 04:31
Three.js Bouncing Ball Changing Colors - https://jsbin.com/cofirip
<!DOCTYPE html>
<html>
<head>
<!-- <script type="text/javascript" src="https://getfirebug.com/firebug-lite-debug.js"></script> -->
<meta name="description" content="Three.js Bouncing Ball Changing Colors" />
<meta charset="utf-8" />
<style>
#container {
background: #000000;
width: 100%;
@SabrinaMarkon
SabrinaMarkon / index.html
Last active March 23, 2019 04:27
Three.js Methane Molecule - https://jsbin.com/jemuwec
<!DOCTYPE html>
<html>
<head>
<!--<script src="https://getfirebug.com/firebug-lite-debug.js"></script>-->
<meta name="description" content=">Three.js Methane Molecule" />
<meta charset="utf-8" />
<title>Three.js Methane Molecule</title>
<style>
#container {
background: #000000;
@SabrinaMarkon
SabrinaMarkon / index.html
Last active March 23, 2019 04:23
Three.js Ruffled Paper Spheres - https://jsbin.com/javatad
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="https://getfirebug.com/firebug-lite-debug.js"></script>
<meta name="description" content="Three.js Ruffled Paper Spheres" />
<meta charset="utf-8" />
<style>
#container {
background: #000000;
width: 100%;
@SabrinaMarkon
SabrinaMarkon / index.html
Last active March 23, 2019 04:19
Three.js Ball Bouncing off Walls - https://jsbin.com/rirahuw
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Three.js Ball Bouncing off Walls</title>
<style id="jsbin-css">
body { background-color:#ededed; font:normal 12px/18px Arial, Helvetica, sans-serif; }
h1 { display:block; width:600px; margin:20px auto; padding-bottom:20px; font:normal 24px/30px Georgia, "Times New Roman", Times, serif; color:#333; text-shadow: 1px 2px 3px #ccc; border-bottom:1px solid #cbcbcb; }
#container { width:600px; margin:0 auto; }