Skip to content

Instantly share code, notes, and snippets.

View kylebakerio's full-sized avatar
⛰️
mountains are really nice, guys.

Kyle Baker kylebakerio

⛰️
mountains are really nice, guys.
View GitHub Profile
@kylebakerio
kylebakerio / README.txt
Last active March 10, 2022 14:04
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.6.0+commit.26b70077.js&optimize=true&runs=200&gist=
just a quick save of some files thrown together when working through the ethernauts problems
@kylebakerio
kylebakerio / iOSiFrameBypass.js
Last active September 11, 2021 16:04
bypassing device orientation ios iframe limitations
// WIP
function iOS() {
return [
'iPad Simulator',
'iPhone Simulator',
'iPod Simulator',
'iPad',
'iPhone',
'iPod'
].includes(navigator.platform)
@kylebakerio
kylebakerio / gist:43cc9366e1a0fc6048256185a7f0cb50
Created February 9, 2021 00:42 — forked from czarneckid/gist:762065
Creating high score leaderboards with Redis
NOTE: You will need at least Redis 2.1.6 to use the ZREVRANGEBYSCORE method.
Add players to HIGHSCORES table:
fossil:~ dczarnecki$ redis-cli
redis> zadd HIGHSCORES 1 player_1
(integer) 1
redis> zadd HIGHSCORES 2 player_2
(integer) 1
redis> zadd HIGHSCORES 3 player_3
me@T460-Debian10:~/code/forks/janus-gateway$ sudo ./janus -F /opt/janus/etc/janus/
[sudo] password for me:
Janus commit: d1d044ce781272715ef621abe9f7ac2f658842e6
Compiled on: Wed 19 Aug 2020 08:21:15 PM EDT
Logger plugins folder: /home/me/code/forks/janus-gateway/loggers
---------------------------------------------------
Starting Meetecho Janus (WebRTC Server) v0.10.5
---------------------------------------------------
{
init: function(){
// console.warn("this way, it will be possible to have mismatched boards for the two players with stones hanging off the invisible edge. should be getting this from other player, along with other room info, but putting that off for now. :/")
// hoverXY = (gameState.iAm === "Wte" ? [-1,9] : [19,9]); // let's try hanging them off the center side instead of corner, where it can be hard to see.
resetHoverStone() // untested, but should be fine; it says reset, but same code as initial set
//Code for goban shape
if (!this.data.boardSize) {
console.warn("no lines, skipping init for a tick")
return
}
@kylebakerio
kylebakerio / ideal-bar-length.js
Last active March 14, 2020 19:40
find optimal minimum groups and minimum size to divide into preset amount requirements
// key is measurement, value is number needed of that measurement
var barLengths = {
"20": 16, // standard + wide dining window height
"25.5": 10, // standard windows width
"37.5": 4, // long dining room windows width
"21.5": 2, // bathroom window width, again, needs updating because of external framing
"6": 2, // bathroom window height, probably needs to be increased a bit because we're framing externally
"31": 2, // door window height, needs verification
};
// if($scope.$storage.currentUser.hiddenGroups || $scope.$storage.currentUser.requiredGroups) { // WE HAVE EITHER REQUIREALL OR BLACK LIST FILTERING ENABLED.
// if($scope.$storage.currentUser.requireGroupsOn) { // WHITE LIST
// // has required groups ON
// if(item.groups) {
// // pin has some groups
// var notInAllRequiredGroups = requiredCount < $scope.$storage.currentUser.requiredGroups.length && $scope.$storage.currentUser.requiredGroups.length > 0
// if(notInAllRequiredGroups) {
// pinShown = false;
// $scope.hiddenPins.push(item)
// conditionCount['("No", 1, "pin has groups + not in all required groups")']++ //
@kylebakerio
kylebakerio / broken-example.html
Created April 6, 2017 03:43
non working example (putting all scripts through lab.js)
<html>
<body ng-app="mapmycustomersApp" ng-strict-di>
<!-- FB Analytics for Web -->
<script>
// stuff
</script>
<!--[if lte IE 8]>
<p class="browsehappy">You are using an <strong>outdated</strong> browser. Please <a href="https://browsehappy.com/">upgrade your browser</a> to improve your experience.</p>
@kylebakerio
kylebakerio / working-example.html
Created April 6, 2017 03:31
this is the working code.
<html>
<body ng-app="mapmycustomersApp" ng-strict-di>
<!-- FB Analytics for Web -->
<script>
// stuff
</script>
<!--[if lte IE 8]>
<p class="browsehappy">You are using an <strong>outdated</strong> browser. Please <a href="https://browsehappy.com/">upgrade your browser</a> to improve your experience.</p>