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
// http://hsbp.org/arduino | |
#include <Stepper.h> | |
Stepper myStepper(100, 8, 10, 9, 11); | |
// The setup() method runs once, when the sketch starts | |
void setup() { | |
// initialize the digital pin as an output: | |
Serial.begin(9600); |
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
void setup() { | |
pinMode(3, OUTPUT); | |
} | |
void loop() { | |
http://hsbp.org | |
PIND |= 8; | |
goto http; | |
} |
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
% depends: https://github.com/talentdeficit/jsx | |
-module(youtube). | |
-export([ircmain/1, ircproc/1, reload/2]). | |
-define(API_KEY, "GetYourOwnApiKeyFromGoogle"). | |
query_gdata_feed(VID) -> | |
URL = "https://www.googleapis.com/youtube/v3/videos?part=snippet&" | |
"fields=items/snippet(channelTitle,title)&key=" ?API_KEY "&id=" ++ VID, |
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
% depends: https://github.com/dnet/erlang-oauth | |
% depends: https://github.com/talentdeficit/jsx | |
-module(tweet). | |
-export([ircmain/1, ircproc/1, reload/2]). | |
-define(CONSUMER_KEY, "..."). | |
-define(CONSUMER_SECRET, "..."). | |
-define(ACCESS_TOKEN, "..."). | |
-define(TOKEN_SECRET, "..."). |
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/sh | |
# reads e-mail addresses (one per row) from `mails.txt` and writes | |
# e-mail bodies into files inside the `mails` directory, putting the | |
# e-mail address in the filename, with a `.txt` extension -- these | |
# can be changed below | |
# author: András Veres-Szentkirályi <vsza@vsza.hu> | |
# source code is licensed under MIT, textual content under CC-BY-SA |
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
-module(tickets). | |
-export([ircmain/1, ircproc/1, reload/2]). | |
-define(TICKETS_DIR, "path/to/campzer0"). | |
tickets() -> | |
NumTickets = filelib:fold_files(?TICKETS_DIR, | |
"\\.json$", false, fun (_, A) -> A + 1 end, 0), | |
integer_to_list(NumTickets). |
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
-module(searx). | |
-export([ircmain/1, ircproc/1, reload/2]). | |
ircmain(Contact) -> | |
Pid = spawn(?MODULE, ircproc, [Contact]), | |
Contact ! {subscribe, Pid}, | |
ssl:start(), | |
Pid. | |
reload(Contact, Pid) -> |
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
-module(test). | |
-export([foo/1, proc/0, price/1]). | |
-export([init_queue/0, queue_server/1, srv_enqueue/2, srv_dequeue/1]). | |
%% A function that returns a function, demonstrating that functions are | |
%% first-class citizens in the Erlang world. | |
%% | |
%% Example: | |
%% > SixMultiplier = test:foo(6). | |
%% #Fun<test.0.23908741> |
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
-module(teszt). | |
-export([init/1, handle_call/3, q/1, init/0]). | |
-behaviour(gen_server). | |
init() -> | |
gen_server:start_link(?MODULE, [], []). | |
q(Pid) -> gen_server:call(Pid, q). | |
init([]) -> {ok, 0}. | |
handle_call(q, _, N) -> {reply, N, N + 1}. |