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
| -- This query answers 'Which cities did Dave travel to in 2023?' | |
| CREATE TABLE episodes ( | |
| id BIGINT AUTO_INCREMENT PRIMARY KEY, | |
| content TEXT NOT NULL, | |
| valid_at DATETIME NOT NULL, | |
| session_id BIGINT, | |
| created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, | |
| INDEX idx_episodes_valid (valid_at) | |
| ); |
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 main | |
| import ( | |
| "bufio" | |
| "fmt" | |
| "log" | |
| "net" | |
| "os" | |
| "strings" | |
| "time" |
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 main | |
| import ( | |
| "bufio" | |
| "context" | |
| "database/sql" | |
| "encoding/binary" | |
| "flag" | |
| "fmt" | |
| "math/rand" |
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 <mysql/mysql.h> | |
| #include <stdio.h> | |
| #include <string.h> | |
| int insert_with_config(char* encoding, bool send_with_long) { | |
| MYSQL *con = mysql_init(NULL); | |
| if (con == NULL) { | |
| fprintf(stderr, "%s\n", mysql_error(con)); | |
| return 1; | |
| } |
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 main | |
| import ( | |
| "context" | |
| "database/sql" | |
| "fmt" | |
| "os" | |
| "sync" | |
| _ "github.com/go-sql-driver/mysql" |
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 main | |
| import ( | |
| "fmt" | |
| "go/ast" | |
| "go/token" | |
| "go/types" | |
| "log" | |
| "strings" |
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
| { dpkg, pkgs, fetchurl, lib, buildFHSUserEnv, makeDesktopItem, systemd, ...}: | |
| let | |
| version = "2.0.9"; | |
| feilian-unwrapped = pkgs.stdenv.mkDerivation rec { | |
| pname = "feilian-unwrapped"; | |
| inherit version; | |
| src = fetchurl { | |
| url = "https://oss-s3.ifeilian.com/linux/FeiLian_Linux_v${version}_r615_97b98b.deb"; |
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/module.h> | |
| #include <linux/kernel.h> | |
| #include <linux/init.h> | |
| #include <linux/fs.h> | |
| #include <linux/tracepoint.h> | |
| #include <asm/syscall.h> | |
| #include <linux/sched.h> | |
| #include <linux/fdtable.h> | |
| #include <linux/slab.h> | |
| #include <linux/delay.h> |
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 main | |
| import ( | |
| "context" | |
| "encoding/json" | |
| v1 "k8s.io/api/core/v1" | |
| "k8s.io/apimachinery/pkg/runtime" | |
| "log" | |
| "net/http" | |
| "os" |
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
| use std::{mem::size_of, ptr::{null, null_mut}}; | |
| use libc::c_void; | |
| use perf_event_open_sys as sys; | |
| fn main() -> std::io::Result<()> { | |
| let mut attrs = sys::bindings::perf_event_attr::default(); | |
| // Populate the fields we need. | |
| attrs.size = std::mem::size_of::<sys::bindings::perf_event_attr>() as u32; | |
| attrs.type_ = sys::bindings::perf_type_id_PERF_TYPE_HARDWARE; |
NewerOlder