Skip to content

Instantly share code, notes, and snippets.

View godwhoa's full-sized avatar
🙃
no time

Joseph Daniel godwhoa

🙃
no time
  • India
  • 03:50 (UTC +05:30)
View GitHub Profile
print "It works. :3 "
@godwhoa
godwhoa / designer.html
Created November 15, 2014 07:58
designer
<link rel="import" href="../cool-clock/cool-clock.html">
<polymer-element name="my-element">
<template>
<style>
:host {
position: absolute;
width: 100%;
height: 100%;
@godwhoa
godwhoa / flip.py
Created March 7, 2015 05:52
table flip kill linux
#!/usr/bin/python
# -*- coding: utf-8 -*-
import upsidedown
import sys
import os
updown = upsidedown.transform(sys.argv[1])
print u"(ノಠ益ಠ)ノ彡 "+updown
os.system("pkill "+sys.argv[1])
@godwhoa
godwhoa / CMakeLists.txt
Last active August 30, 2015 19:57
Getting YouCompleteMe working on 32bit linux
# Copyright (C) 2011, 2012 Google Inc.
#
# This file is part of YouCompleteMe.
#
# YouCompleteMe is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# YouCompleteMe is distributed in the hope that it will be useful,
@godwhoa
godwhoa / cop
Last active November 17, 2015 00:21
copy and paste files when using separate shells
#!/usr/bin/python
import sys,os
clip = os.environ['HOME']+'/.fileclip'
path = sys.argv[1]
f=open(clip,'w')
f.write(os.getcwd()+'/'+path)
f.close()
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,
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)) {
@godwhoa
godwhoa / Elegant Login Form.markdown
Created December 3, 2015 18:15
Elegant Login Form
@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.

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()