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 | |
if [ -z "$1" ] ; then | |
dev=/dev/md0 | |
else | |
dev=$1 | |
fi | |
mdadm --detail $dev | | |
awk ' h == 1 { print $0; } /Number.*Major.*Minor.*RaidDevice.*State/ { h = 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
#include <stdio.h> | |
#include "lua.h" | |
#include "lauxlib.h" | |
#include "lualib.h" | |
static int outergc(lua_State *L) { | |
void * n = lua_touserdata(L, lua_upvalueindex(1)); | |
void * o = lua_touserdata(L, -1); | |
printf("Outer gc called on %p with upvalue = %p\n", o, n); |
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 <stdint.h> | |
#include <stdio.h> | |
static inline uint8_t from_BCD(uint8_t x) { return ((x & 0x0f) + ((x & 0xf0) >> 4) * 10); } | |
static inline uint32_t from_MSF(uint8_t m, uint8_t s, uint8_t f) { | |
return (from_BCD(m) * 60 + from_BCD(s)) * 75 + from_BCD(f); | |
} | |
static void probe_sector(const uint8_t* sector, unsigned expected_lba) { | |
// do we have a sync pattern? |
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
workspace(name = "grpc_example") | |
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") | |
http_archive( | |
name = "com_github_grpc_grpc", | |
sha256 = "bbc8f020f4e85ec029b047fab939b8c81f3d67254b5c724e1003a2bc49ddd123", | |
strip_prefix = "grpc-d8f4928fa779f6005a7fe55a176bdb373b0f910f", | |
urls = ["https://github.com/grpc/grpc/archive/d8f4928fa779f6005a7fe55a176bdb373b0f910f.tar.gz"], | |
) |
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 strict' | |
const {promisify} = require('util') | |
const download = promisify(require('download-git-repo')) | |
const fs = require('fs') | |
const glob = promisify(require('glob')) | |
const yaml = require('js-yaml') | |
const data = [] |
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
class DiscreteCos { | |
public: | |
DiscreteCos() { generate(); } | |
static const unsigned int DC_2PI = 2048; | |
static const unsigned int DC_PI = 1024; | |
static const unsigned int DC_PI2 = 512; | |
int32_t cos(unsigned int t) { | |
t %= DC_2PI; | |
int32_t r; |
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
class DiscreteCos { | |
public: | |
DiscreteCos() { generate(); } | |
static const unsigned int DC_2PI = 2048; | |
static const unsigned int DC_PI = 1024; | |
static const unsigned int DC_PI2 = 512; | |
int32_t cos(unsigned int t) { | |
t %= DC_2PI; | |
int32_t r; |
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
#define NOMINMAX | |
#define _CRT_SECURE_NO_WARNINGS | |
#ifdef _WIN32 | |
#define WIN32LEANANDMEAN | |
#include <windows.h> | |
#endif | |
#include <assert.h> | |
#include <ctype.h> | |
#include <stdint.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
const github = require('octonode') | |
const repoName = /* repository name */ | |
const client = github.client(/* user token */) | |
const repo = client.repo(repoName) | |
async function migrateAll() { | |
let page = 1 | |
while (true) { | |
const prsResult = await repo.prsAsync({page: page, state: 'open'}) |
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
static void gen_pre_buf(uint8_t * pre_buf, uint8_t (*get_byte)(void *), void * opaque) { | |
int i; | |
memset(pre_buf, 0, 1024); | |
for (i = 0; i < 256; i++) { | |
pre_buf[i + 256] = i; | |
pre_buf[i * 2 + 512] = i; | |
} |
NewerOlder