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
/********* Sample code generated by the curl command line tool ********** | |
* All curl_easy_setopt() options are documented at: | |
* https://curl.se/libcurl/c/curl_easy_setopt.html | |
************************************************************************/ | |
// Pick up Hackaday home page | |
#include <curl/curl.h> | |
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
// For best results use Normal trigger mode | |
#define CLOCK 6 // ch1 | |
#define DATA 15 // ch2 | |
#define RS232_OUT 0 // D0 -- by default; this symbol is not used | |
#define RS232_IN 1 // not really used | |
#define ANALOG_CLEAR 21 // Discharge analog capacitor fast |
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
# This is what's wrong with class variables in Python | |
# and yes, properties work (don't work) the same way | |
# This is a stupid but clean example where class A | |
# has a class variable x. It also has direct subclasses | |
# B and C | |
# Then there is a subclass of C named D | |
# None of them should have an x variable, but they all will get one | |
class A: |
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
import asyncio | |
import testb | |
state={'done': 0 } | |
async def taskA(): | |
global done | |
print("A") | |
await asyncio.sleep(5) | |
print("A'") |
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 <stdio.h> | |
#include <stdlib.h> | |
#include <printf.h> | |
static int print_coin (FILE *stream, | |
const struct printf_info *info, | |
const void *const *args) | |
{ |
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 <stdio.h> | |
#include <string.h> | |
#include <stdlib.h> | |
#include <ctype.h> | |
float stack[32]; | |
unsigned sp=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
// Simple 1802 Literate Program | |
#include "lit1802.h" | |
#define ON 1 | |
#define OFF 0 | |
#define DELAYPC 9 // delay subroutine | |
#define DELAYR 8 // delay count register | |
#define MAINPC 3 // Main routine PC |
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
#!/bin/bash | |
clear | |
# init colors | |
FG="#00ffff" | |
BFG="#00ff00" | |
# if you wonder why true is in there https://www.shellcheck.net/wiki/SC2015 | |
gum confirm --default --affirmative="Play now" --negative="Dump source first" --timeout=10s "Would you like to view the source code before playing?" && true || ( gum format -t code <"$0" ) | |
# get initial info | |
gum style --foreground "$FG" --border-foreground "$BFG" --border double --align center --width 64 --margin "1 2" --padding "2 4" \ |
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
#!/bin/bash | |
#baloo-nice by Al Williams | |
if [ "$1" == "fast" ] | |
then | |
RLIMIT=100048576 # bps limit (read) | |
WLIMIT=100048576 # bps limit (write) | |
else | |
RLIMIT=548576 # bps limit (read) | |
WLIMIT=548576 # bps limit (write) |
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 <sqlite3.h> | |
#include <stdio.h> | |
int main(int argc, char *argv[]) | |
{ | |
sqlite3 *db; | |
sqlite3_stmt *sql; | |
int rv; | |
rv=sqlite3_open("parts.db",&db); |
NewerOlder