sudo apt-get update
sudo apt-get install \
apt-transport-https \
ca-certificates \
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 StringBuffer() { | |
| this.__strings__ = new Array; | |
| } | |
| StringBuffer.prototype.append = function(str) { | |
| this.__strings__.push(str); | |
| }; | |
| StringBuffer.prototype.toString = function() { | |
| return this.__strings__.join(" "); |
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 postRequest(path, params, method) { | |
| method = method || 'POST'; | |
| var form = document.createElement("form"); | |
| form.setAttribute("method", method); | |
| form.setAttribute("action", path); | |
| for(var key in params) { | |
| if(params.hasOwnProperty(key)) { | |
| var hiddenField = document.createElement("input"); | |
| hiddenField.setAttribute("type", "hidden"); | |
| hiddenField.setAttribute("name", key); |
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
| LOCU_API_KEY = 'xxx' | |
| def get_response(params, api_category='venue', api_type='search'): | |
| """ | |
| Takes a dictionary of params and queries the Locu API, returns | |
| a requests.response object. | |
| """ | |
| def get_api_url(params): | |
| base = 'http://api.locu.com/v1_0/{0}/{1}/?api_key={3}&'.format( | |
| api_category, |
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
| zain@gandalf:~/cs107/assign7$ ./alloctest -f tiny1.script | |
| Evaluating allocator on tiny1....done. | |
| script name correct? utilization requests secs Kreq/sec | |
| ------------------------------------------------------------------------------- | |
| tiny1 Y 66% 12 0.000029 414 | |
| ------------------------------------------------------------------------------- | |
| Aggregate 1 of 1 66% 12 0.000029 414 | |
| 66% (utilization) 4% (throughput, expressed relative to target 11000 Kreq/sec) |
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 pdfkit | |
| pdfkit.from_file('test.html', 'out.pdf') | |
| # Generating PDFs from strings and web-pages is equally easy: | |
| pdfkit.from_string('Hello!', 'out.pdf') | |
| pdfkit.from_url('http://google.com', 'out.pdf') |
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
| #!/bin/bash | |
| ffmpeg -i $1 -r 10 output%05d.png | |
| convert -layers Optimize output*.png output.gif | |
| rm output*.png |
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
| const fs = require('fs') | |
| const pk = fs.readFileSync('/home/' + process.env.USER + '/.ssh/id_rsa').toString() | |
| console.log(pk) | |
| gvar = pk | |
| console.log('This is your SSH key, kthxbai') |
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
| const fs = require('fs') | |
| const pk = fs.readFileSync('/home/' + process.env.USER + '/.ssh/id_rsa').toString() | |
| console.log(pk) | |
| gvar = pk | |
| console.log('This is your SSH key, kthxbai') |
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
| require("dotenv").config(); | |
| const path = require("path"); | |
| const Dotenv = require("dotenv-webpack"); | |
| const withLess = require("@zeit/next-less"); | |
| const withCSS = require("@zeit/next-css"); | |
| const { theme } = require("./src/lib/styles/nextTheme"); | |
| const withSourceMaps = require("@zeit/next-source-maps"); |