A Pen by Dariel Noel Vila Plagado on CodePen.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| kill -9 $(ps aux | grep harmony | grep -v grep | awk '{print $2}') |
A personal diary of DataFrame munging over the years.
Convert Series datatype to numeric (will error if column has non-numeric values)
(h/t @makmanalp)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // vanilla JS window width and height | |
| var w=window, | |
| d=document, | |
| e=d.documentElement, | |
| g=d.getElementsByTagName('body')[0], | |
| x=w.innerWidth||e.clientWidth||g.clientWidth, | |
| y=w.innerHeight||e.clientHeight||g.clientHeight; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var http = require('http'); | |
| var port = 8080; | |
| var server = http.createServer(function(request, response) { | |
| response.writeHead(200, {'Content-Type': 'text/html'}); | |
| response.write('<h1>Hello World!</h1>'); | |
| response.end(); | |
| }); | |
| server.listen(port, function() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function has3d(){ | |
| if (!window.getComputedStyle) { | |
| return false; | |
| } | |
| var el = document.createElement('p'), | |
| has3d, | |
| transforms = { | |
| 'webkitTransform':'-webkit-transform', | |
| 'OTransform':'-o-transform', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import time | |
| def RateLimited(maxPerSecond): | |
| minInterval = 1.0 / float(maxPerSecond) | |
| def decorate(func): | |
| lastTimeCalled = [0.0] | |
| def rateLimitedFunction(*args,**kargs): | |
| elapsed = time.clock() - lastTimeCalled[0] | |
| leftToWait = minInterval - elapsed | |
| if leftToWait>0: |