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
#include <linux/linkage.h> | |
#include <linux/kernel.h> | |
#include <linux/sched.h> | |
#include <linux/mm.h> | |
#include <asm-i386/page.h> | |
#include <asm-i386/pgtable.h> | |
asmlinkage long sys_project(unsigned long pid1, unsigned long pid2){ | |
struct vm_area_struct *vm; /* loop counter to loop through all vm section */ |
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
CC := gcc | |
LD := ld | |
ASFLAGS := -c | |
LDFLAGS := -T link.ld | |
all: boot_32.bin | |
boot_32.bin: boot_32.o | |
@${LD} ${LDFLAGS} | |
@echo "LINK $@" |
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
#![feature(proc_macro_hygiene, decl_macro)] | |
#[macro_use] | |
extern crate rocket; | |
#[macro_use] | |
extern crate rocket_contrib; | |
#[macro_use] | |
extern crate serde_derive; | |
#[post("/register")] | |
fn register() -> &'static str { |
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] | |
name = "microgram_server" | |
version = "0.1.0" | |
authors = ["mike820324 <[email protected]>"] | |
edition = "2018" | |
[dependencies] | |
rocket = "0.4.0" | |
rocket_contrib = "0.4.0" | |
serde = "1.0.86" | |
serde_derive = "1.0.86" |
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
#[derive(Deserialize)] | |
struct RegisterData { | |
username: String, | |
password: String, | |
email: String, | |
} | |
#[post("/register", format = "json", data = "<data>")] | |
fn register(data: JSON<ResigterData> ) -> JsonValue { | |
json!({"success": data.email}) | |
} |
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
#![feature(proc_macro_hygiene, decl_macro)] | |
#[macro_use] | |
extern crate rocket; | |
#[macro_use] | |
extern crate rocket_contrib; | |
#[macro_use] | |
extern crate serde_derive; | |
use rocket_contrib::json::{Json, JsonValue}; |
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
$medium_url = "https://api.rss2json.com/v1/api.json?rss_url=https://medium.com/feed/" . $handle; |
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
... | |
foreach ($posts as $post) { | |
if (count($post->categories) == 0) { | |
continue; | |
} | |
... | |
} |
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 graphql_query = ` | |
query UserStreamOverview($userId: ID!, $pagingOptions: PagingOptions) { | |
user(username: $userId) { | |
name | |
profileStreamConnection(paging: $pagingOptions) { | |
...commonStreamConnection | |
__typename | |
} | |
__typename | |
} |
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
query UserStreamOverview($userId: ID!, $pagingOptions: PagingOptions) { | |
user(username: $userId) { | |
name | |
profileStreamConnection(paging: $pagingOptions) { | |
...commonStreamConnection | |
__typename | |
} | |
__typename | |
} | |
} |