Lecture 1: Introduction to Research — [📝Lecture Notebooks] [
Lecture 2: Introduction to Python — [📝Lecture Notebooks] [
Lecture 3: Introduction to NumPy — [📝Lecture Notebooks] [
Lecture 4: Introduction to pandas — [📝Lecture Notebooks] [
Lecture 5: Plotting Data — [📝Lecture Notebooks] [[
| package main | |
| import ( | |
| "context" | |
| "encoding/json" | |
| "fmt" | |
| "reflect" | |
| "github.com/olivere/elastic" | |
| ) |
I screwed up using git ("git checkout --" on the wrong file) and managed to delete the code I had just written... but it was still running in a process in a docker container. Here's how I got it back, using https://pypi.python.org/pypi/pyrasite/ and https://pypi.python.org/pypi/uncompyle6
apt-get update && apt-get install gdb
| // Turn on Developer Mode under User Settings > Appearance > Developer Mode (at the bottom) | |
| // Then open the channel you wish to delete all of the messages (could be a DM) and click the three dots on the far right. | |
| // Click "Copy ID" and paste that instead of LAST_MESSAGE_ID. | |
| // Copy / paste the below script into the JavaScript console. | |
| // If you're in a DM you will receive a 403 error for every message the other user sent (you don't have permission to delete their messages). | |
| var before = 'LAST_MESSAGE_ID'; | |
| clearMessages = function(){ | |
| const authToken = document.body.appendChild(document.createElement`iframe`).contentWindow.localStorage.token.replace(/"/g, ""); | |
| const channel = window.location.href.split('/').pop(); |
I became interested in string clustering through developing fpos, a set of Python scripts for graphing my spending habits. In a clear failure of research I missed the existance of libraries like:
| var page = new WebPage(); | |
| //spoof it as opera mini, to get the mobile page working properly | |
| page.settings.userAgent = "Opera/9.80 (J2ME/MIDP; Opera Mini/6.5.26955/27.1407; U; en) Presto/2.8.119 Version/11.10"; | |
| function doLogin(){ | |
| page.evaluate(function(){ | |
| var frm = document.getElementById("login_form"); | |
| frm.elements["email"].value = "--enter-your-email--"; |
The 0.13.0 improvements to React Components are often framed as "es6 classes" but being able to use the new class syntax isn't really the big change. The main thing of note in 0.13 is that React Components are no longer special objects that need to be created using a specific method (createClass()). One of the benefits of this change is that you can use the es6 class syntax, but also tons of other patterns work as well!
Below are a few examples creating React components that all work as expected using a bunch of JS object creation patterns (https://github.com/getify/You-Dont-Know-JS/blob/master/this%20&%20object%20prototypes/ch4.md#mixins). All of the examples are of stateful components, and so need to delegate to React.Component for setState(), but if you have stateless components each patterns tends to get even simpler. The one major caveat with react components is that you need to assign props and context to the component instance otherwise the component will be static. The reason is