start new:
tmux
start new with session name:
tmux new -s myname
| #include <iostream> | |
| using namespace std; | |
| int main() | |
| { | |
| cout << "test" << endl; | |
| #!/usr/bin/env python | |
| from django.core.management import execute_manager | |
| try: | |
| import settings # Assumed to be in the same directory. | |
| except ImportError: | |
| import sys | |
| sys.stderr.write("Error: Can't find the file 'settings.py' in the directory containing %r. It appears you've customized things.\nYou'll have to run django-admin.py, passing it your settings module.\n(If the file settings.py does indeed exist, it's causing an ImportError somehow.)\n" % __file__) | |
| sys.exit(1) | |
| if __name__ == "__main__": |
| var express = require('express'); | |
| var request = require('request'); | |
| var app = express(); | |
| var APICALLNAME = 'set this here ... maybe other names I have no idea, nick' | |
| app.get('/'+APICALLNAME, function(req, res) { | |
| request.get({ | |
| url: 'twitter apicall url', json:true}, function(error, response, body){ | |
| res.json(response); // assuming you're getting json not other stuff like xml or something | |
| }); | |
| }); |
| function moveThroughYelp(data, type){ | |
| var setOfInfo = [] | |
| for(var i = 0; i< data.businesses.length; ++i){ | |
| var info = {} | |
| if (!data.businesses[i].is_closed || (type === 'food' && data.businesses[i].rating<2 ) ) continue; | |
| info.rating = data.businesses[i].rating; | |
| info.rating_img_url_small= data.businesses[i].rating_img_url_small; | |
| info.rating_img_url_large = data.businesses[i].rating_img_url_large; | |
| info.rating_img_url = data.businesses[i].rating_img_url; | |
| info.address = data.businesses[i].location.address + ' ' + data.businesses[i].location.city + ', ' + data.businesses[i].location.state_code + ' ' +data.businesses[i].location.postal_code |
| $(document).ready(function(){ | |
| TableBuilder = function(username, tabledata){ | |
| this.username = username; | |
| this.tabledata = tabledata; | |
| } | |
| TableBuilder.prototype.populateTable = function() { | |
| var self = this; | |
| var tableId = 'my-table'; | |
| this.dynatable = $('#'+tableId).dynatable({ |
| /** @jsx React.DOM */ | |
| var LikeButton = React.createClass({ | |
| getInitialState: function() { | |
| return {liked: false}; | |
| }, | |
| handleClick: function(event) { | |
| this.setState({liked: !this.state.liked}); | |
| }, | |
| render: function() { |
| #include <iostream> | |
| #include <fstream> | |
| using namespace std; | |
| template<size_t n, size_t k> struct combo; | |
| template<size_t n> | |
| struct combo<n,0>{ | |
| const static auto value =1; |
| import numpy as np | |
| from memory_profiler import profile | |
| @profile | |
| def main(): | |
| a = np.ones((1000,1000)) | |
| a = a +1 | |
| print(a) | |
| main() |
| #learned from complex analysis class that the known way of integrating 1/(1+x^2) is by applying the resideue theorem | |
| import scipy.integrate as i | |
| import numpy as np | |
| f = lambda x: 1.0/(1+x**2) | |
| print(str(i.quad(f,0,np.inf)[0])) |