Skip to content

Instantly share code, notes, and snippets.

@Linkaan
Linkaan / playlist.ino
Created February 5, 2020 08:06
Playlist Arduino
#include <LiquidCrystal.h>
#include <avr/pgmspace.h>
#include <string.h>
#include "songs.h"
#define encoder0PinA 2
#define encoder0PinB 3
#define encoder0PinC 8
#define NOTE_C1 33
@Linkaan
Linkaan / build_nginx.sh
Last active March 15, 2017 13:45 — forked from MattWilcox/build_nginx.sh
Fetch, build, and install the latest nginx with the latest OpenSSL for RaspberryPi
#!/usr/bin/env bash
# URLs to the source directories
export SOURCE_OPENSSL=https://www.openssl.org/source/
export SOURCE_PCRE=ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/
export SOURCE_NGINX=http://nginx.org/download/
# ensure that we have the required software to compile our own nginx
apt-get -y install curl wget build-essential
puts "Hello, World!"
print "Hello, World!"
#include <stdio.h>
int main(void) {
printf("Hello, World!\n");
return 0;
}
#!/bin/sh
# Try to bring picam up when an interface comes up.
# Don't bother to do anything for lo.
if [ "$IFACE" = lo ]; then
exit 0
fi
# Only run from ifup.
if [ "$MODE" != start ]; then
avconv -i tcp://127.0.0.1:8181?listen -c:v copy -c:a aac -strict -2 -ar 44100 -ab 40000 -f flv rtmp://1.21550888.fme.ustream.tv/ustreamVideo/21550888/mPqsDH2dWMqVmSptpfRytBGeETLc3DxQ
#include <NewPing.h>
#define MAX_TIME 17202
#define TRIGGER_PIN 10 // Arduino pin tied to trigger pin on ping sensor.
#define ECHO_PIN 9 // Arduino pin tied to echo pin on ping sensor.
#define MAX_DISTANCE 200 // Maximum distance we want to ping for (in centimeters). Maximum sensor distance is rated at 400-500cm.
NewPing sonar(TRIGGER_PIN, ECHO_PIN, MAX_DISTANCE); // NewPing setup of pins and maximum distance.
#include <iostream>
#include <cstring>
#include <vector>
#include <string>
int main ()
{
std::vector<std::string> tokens;
std::vector<std::string>::iterator it;
std::string str ("homework! my do Please");
@Linkaan
Linkaan / precompute.c
Created October 19, 2015 21:53
Redirect standard output to table.h and include that in the main program.
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#define MAX 1000000
void permute(unsigned int **result, char *a, int l, int r, int *len);
int main() {
int i, k, j, len;