Skip to content

Instantly share code, notes, and snippets.

name: TOPHAP
description: ''
host: EXCEL
api_set: {}
script:
content: |-
/**
* Fetch property details for an address string.
* Example: `console.log(await address('265 eagle ct', 'alamo', 'ca'))`
* @customfunction
module ram(
input clk,
input rst,
input write_enable,
input [15:0] data_write,
inout [15:0] MemDB,
output reg [15:0] data_read,
output RamAdv, RamClk, RamCS, MemOE, MemWR, RamLB, RamUB,
@ryanmjacobs
ryanmjacobs / c99_designators_in_const_struct.c
Last active April 25, 2018 23:25
Example of C99 Designator Clauses inside a `const struct`
// temp. includes so that the compiler doesn't complain
// (delete these three lines when you import the code)
#include <stdio.h>
#include <stdint.h>
#include <stdbool.h>
struct spi_devices_struct {
char manu[10]; // ID winbond 0xef.
char device[10]; // ID string (ie W25Q16BV)
uint8_t manId; // manu ID
// make sure to unbind your device first
// https://stackoverflow.com/questions/47695160/failed-to-claim-interface-0-device-or-resource-busy
// echo -n "1-1.3:1.0" | sudo tee /sys/bus/usb/drivers/ch341/unbind
let device;
async function connectDevice(dev) {
await dev.open();
if (dev.configuration === null)
await dev.selectConfiguration(1).catch(error => { log(error); });
#include <time.h>
#include <stdio.h>
#include <stdlib.h>
#define NUM_TRIALS 1e9
int randint(int n);
unsigned int play(void);
int main(void) {
import java.util.Random;
public class RollSimulation {
public static void main(String[] args) {
Random rand = new Random();
for (int f = 1; f <= 6; f++) {
int[] rolls1 = new int[8];
int[] rolls2 = new int[8];
# Contributor: Jakub Luzny <limoto94@gmail.com>
# Maintainer: SanskritFritz (gmail)
pkgname=sl-git
_gitname=sl
pkgver=5.02.r0.g0fd8d6f
pkgrel=1
pkgdesc='Steam Locomotive runs across your terminal when you type "sl" as you meant to type "ls"'
arch=('i686' 'x86_64' 'arm')
url="http://www.tkl.iis.u-tokyo.ac.jp/~toyoda/index_e.html"
enum states_t {
WAIT, /* Wait until the soil is dry, then take action. */
PUMP_BUFFER, /* Pump buffer reservoir until 90% capacity. */
WATER_SOIL /* Water the soil until it isn't dry anymore. */
};
enum states_t state = WAIT;
while (1) {
switch (state) {
/**
* NOTE:
* The shell script at the bottom of the page is
* more reliable and less buggy. Go use that instead.
*
* Usage: pop [path to cd-drive]
* Compile: gcc pop.c -o pop
*/
#include <stdio.h>
@ryanmjacobs
ryanmjacobs / README.md
Last active August 29, 2015 14:14
Obama meme test
$ git clone https://gist.github.com/ryanmjacobs/78e23e05bba048292768 obama_meme_test
$ cd obama_meme_test
$ gem install meme_captain
$ chmod +x obama_meme.rb
$ ./obama_meme.rb