This file contains 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
sudo /Applications/Install\ OS\ X\ Yosemite.app/Contents/Resources/createinstallmedia --volume /Volumes/Stick --applicationpath /Applications/Install\ OS\ X\ Yosemite.app --nointeraction |
This file contains 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
/* | |
The example in this topic demonstrates how to create a child process using the CreateProcess function from a console process. It also demonstrates a technique for using anonymous pipes to redirect the child process's standard input and output handles. Note that named pipes can also be used to redirect process I/O. | |
The CreatePipe function uses the SECURITY_ATTRIBUTES structure to create inheritable handles to the read and write ends of two pipes. The read end of one pipe serves as standard input for the child process, and the write end of the other pipe is the standard output for the child process. These pipe handles are specified in the STARTUPINFO structure, which makes them the standard handles inherited by the child process. | |
The parent process uses the opposite ends of these two pipes to write to the child process's input and read from the child process's output. As specified in the STARTUPINFO structure, these handles are also inheritable. However, these handles must not be inherited. Therefore, befo |
This file contains 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
#include <iostream> | |
#include <stdio.h> | |
using namespace std; | |
int main() { | |
FILE *in; | |
char buff[512]; | |
if(!(in = popen("ls -sail", "r"))){ |
This file contains 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
#include <cstring> | |
#include <fstream> | |
using namespace std; | |
/*** vxor_streambuf class ******************************************/ | |
class vxor_streambuf: public streambuf | |
{ | |
public: |
This file contains 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
#include <cstdio> | |
#include <iostream> | |
#include <fstream> | |
#define BUFFER_SIZE 1024 | |
class popen_streambuf : public std::streambuf { | |
public: | |
popen_streambuf() | |
: _fp(NULL) |
This file contains 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
std::vector<std::string> &split(const std::string &s, char delim, std::vector<std::string> &elems) { | |
std::stringstream ss(s); | |
std::string item; | |
while (std::getline(ss, item, delim)) { | |
elems.push_back(item); | |
} | |
return elems; | |
} | |
This file contains 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 fuzzy_match(text, search) | |
{ | |
/* | |
Parameter text is a title, search is the user's search | |
*/ | |
// remove spaces, lower case the search so the search | |
// is case insensitive | |
var search = search.replace(/\ /g, '').toLowerCase(); | |
var tokens = []; | |
var search_position = 0; |
This file contains 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
from flask import Flask, request, send_from_directory | |
# set the project root directory as the static folder, you can set others. | |
app = Flask(__name__, static_url_path='') | |
@app.route('/js/<path:path>') | |
def send_js(path): | |
return send_from_directory('js', path) | |
if __name__ == "__main__": |
This file contains 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
#define List(o) \ | |
o(1,2) \ | |
o(2,3) \ | |
#define MAP_CALL_FN_PARENS(...) (__VA_ARGS__); | |
#define MAP_CALL_FN(fn) fn MAP_CALL_FN_PARENS | |
#define MAP(list, fn, ...) list(MAP_CALL_FN(fn)) |
This file contains 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
tinymce.init({ | |
file_browser_callback: function(field_name, url, type, win) { | |
tinymce.activeEditor.windowManager.open({ | |
title: "My file browser", | |
url: "myfilebrowser.html", | |
width: 800, | |
height: 600 | |
}, { | |
oninsert: function(url) { | |
win.document.getElementById(field_name).value = url; |
OlderNewer