Skip to content

Instantly share code, notes, and snippets.

View godwhoa's full-sized avatar
🙃
no time

Joseph Daniel godwhoa

🙃
no time
  • India
  • 19:31 (UTC +05:30)
View GitHub Profile
@godwhoa
godwhoa / main.py
Last active May 17, 2019 11:18 — forked from sairoopb/main.py
def get_html_array(js_url):
response = requests.get(js_url)
# Apply capture logic
start = response.text.find("var html = [") + len("var html = [") - 1 # this will get us the index of [
end = response.text.find(".join('\n')")
raw_js_array = response.text[start:end]
# really not sure whats going on down here..
json_file = []
for data in range(result+12,end-1):
json_file.append(data)
@godwhoa
godwhoa / notes.md
Created February 6, 2019 07:24
Lift scala
scala> val pf: PartialFunction[Int, Boolean] = { case i if i > 0 => i % 2 == 0}
pf: PartialFunction[Int,Boolean] = <function1>

scala> pf
res0: PartialFunction[Int,Boolean] = <function1>

scala> pf(-1)
scala.MatchError: -1 (of class java.lang.Integer)
@godwhoa
godwhoa / basic-vue-router-example.markdown
Created January 20, 2017 05:57
Basic Vue Router Example
// Copyright 2012 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// +build !plan9
package main
import (
"log"
package main
import (
"crypto/tls"
"fmt"
"gopkg.in/sorcix/irc.v1"
"net"
)
var (
diff --git a/src/TileLayer.lua b/src/TileLayer.lua
index ecc40b2..f54836b 100644
--- a/src/TileLayer.lua
+++ b/src/TileLayer.lua
@@ -223,7 +223,7 @@ function TileLayer:draw(x,y)
local tile_iterator = self:_getTileIterator()
for _,batch in pairs(self._batches) do
- batch:bind()
+ batch:flush()
@godwhoa
godwhoa / JS Game Loop: Fixed time-step, variable rendering.markdown
Created March 5, 2016 20:26
JS Game Loop: Fixed time-step, variable rendering

JS Game Loop: Fixed time-step, variable rendering

A fixed time-step with variable rendering using interpolation from the sprites previous position plus its current velocity to calculate its final render position.

Resources: http://gafferongames.com/game-physics/fix-your-timestep/ http://gameprogrammingpatterns.com/game-loop.html http://www.html5gamedevs.com/topic/8716-game-loop-fixed-timestep-variable-rendering/

Forked from Anthony Del Ciotto's Pen JS Game Loop: Fixed time-step, variable rendering.

@godwhoa
godwhoa / Elegant Login Form.markdown
Created December 3, 2015 18:15
Elegant Login Form
String.prototype.contains = function(it) {
return this.indexOf(it) != -1;
};
function suggest(word) {
var sug = new Array();
var lookup = dict[alpha[word[0]]]
for (var i = 0; i < lookup.length; i++) {
var j = lookup[i]
if (j.contains(word)) {
This file has been truncated, but you can view the full file.
var alpha = {'a': 0,
'b': 1,
'c': 2,
'd': 3,
'e': 4,
'f': 5,
'g': 6,
'h': 7,
'i': 8,
'j': 9,