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 psutil | |
import time | |
import matplotlib.pyplot as plt | |
def start(): | |
cpu_cores = psutil.cpu_count() | |
time_range = [i for i in range(60)] | |
cores = [] |
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
#!/usr/bin/env node | |
var fs = require("fs"); | |
var http = require("https"); | |
var options = { | |
key: fs.readFileSync('key.pem'), | |
cert: fs.readFileSync('cert.pem') | |
}; |
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
#remove all .orig files in a particular directory recursively | |
find . -name '*.orig' -delete | |
#rebase | |
git rebase -i HEAD~3 | |
#undo commit and redo: | |
$ git commit -m "Something terribly misguided" | |
$ git reset HEAD~ | |
#edit files as necessary |
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
#!/usr/bin/env node | |
var http = require("http"); | |
var server = http.createServer(function(request, response) { | |
console.log('-------------------------'); | |
console.log(request.headers); | |
request.on('data', function(chunk) { | |
console.log("Received body data:"); | |
console.log(chunk.toString()); |
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
syntax on | |
set nu | |
color koehler | |
filetype plugin indent on | |
set tabstop=4 | |
set shiftwidth=4 | |
set expandtab | |
set listchars=eol:¶,tab:->,trail:~,extends:>,precedes:<,space:· | |
set list |
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
#!/usr/bin/env node | |
function celebrityIDCreator (theCelebrities) { | |
var i; | |
var uniqueID = 100; | |
for (i = 0; i < theCelebrities.length; i++) { | |
theCelebrities[i]["id"] = function (j) { | |
// the j parametric variable is the i passed in on invocation of this IIFE | |
return function () { | |
return uniqueID + j; |
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
package x.y.z; | |
import java.util.HashMap; | |
import java.util.Map; | |
/** | |
* Hello world! | |
* | |
*/ | |
public class App { |
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
/* | |
C socket server example, handles multiple clients using threads | |
Compile | |
gcc server.c -lpthread -o server | |
*/ | |
#include<stdio.h> | |
#include<string.h> //strlen | |
#include<stdlib.h> //strlen | |
#include<sys/socket.h> |