Skip to content

Instantly share code, notes, and snippets.

View pelatge's full-sized avatar
:octocat:
Focusing

pelatge pelatge

:octocat:
Focusing
View GitHub Profile

Erlang/Elixir syntax reference

This reference is aimed at allowing you to comfortably read erlang documentation and consume terms printed in Erlang format. It does not aim at allowing you to write Erlang code.

This is a modified version of http://elixir-lang.org/crash-course.html

Data types

Erlang and Elixir have the same data types for the most part, but there are a number of differences.

@pelatge
pelatge / wifi-cli-connection.txt
Created September 22, 2022 21:04 — forked from debxp/wifi-cli-connection.txt
Wifi connection from command line after a Debian minimal install
Create the file 'wpa_supplicant.conf'...
$ sudo nano /etc/wpa_supplicant.conf
Put the following in ti:
network={
ssid="your_wifi_name"
psk="your_wifi_password"
}
@pelatge
pelatge / c_memory.org
Created May 12, 2022 14:05 — forked from nicknapoli82/c_memory.org
Everything in c is a pointer!

Everything in C is a pointer!

That’s right. I’m making this statement. This little write-up is an attempt at explaining how any why everything in the c programming language is actually just a pointer. This is simply an attempt at explaining how memory in the computer is arranged in a narrowed view and my real goal is to consider the most simple examples possible.

I will be focusing on x86 specifically.

Types in c (bits and bytes) - and pointers

I would feel pretty confident that you, by now, understand that the types in c are simply identifiers in how much space is used to represent a number. I have no interest in explaining the difference between signed vs unsigned integers. Nor am I going to explain how floating point numbers are represented. If you are interested in those things take a look at these two links. C data types and [[https://en.wikipedia.org/wiki/Floating-point_ari

@pelatge
pelatge / ANSI-color-codes.h
Created October 28, 2021 00:25 — forked from RabaDabaDoba/ANSI-color-codes.h
The entire table of ANSI color codes working in C!
/*
* This is free and unencumbered software released into the public domain.
*
* For more information, please refer to <https://unlicense.org>
*/
//Regular text
#define BLK "\e[0;30m"
#define RED "\e[0;31m"
#define GRN "\e[0;32m"
@pelatge
pelatge / sample.js
Created February 13, 2021 18:50 — forked from khaled-11/sample.js
Botai API endpoint sample.
// This is POST endpoint in Node.js (Express) server.
app.post(`/botai_end`, async function(request, response) {
// Prepare template response items.
var elements = []
elements[elements.length]={"title": "test 1" ,"image_url":"https://e55321204fac.ngrok.io/s_3.jpg", "subtitle":"test", "default_action": {"type": "web_url","url": `https://botai.me`,"messenger_extensions": "true","webview_height_ratio": "full"},"buttons":[{"type":"web_url","url":"https://botai.me","title":"See More"}]}
elements[elements.length]={"title": "Test 2" ,"image_url":"https://e55321204fac.ngrok.io/s_3.jpg", "subtitle":"test", "default_action": {"type": "web_url","url": `https://botai.me`,"messenger_extensions": "true","webview_height_ratio": "full"},"buttons":[{"type":"web_url","url":"https://botai.me","title":"See More"}]}
elements[elements.length]={"title": "test 3" ,"image_url":"https://e55321204fac.ngrok.io/s_3.jpg", "subtitle":"test", "default_action": {"type": "web_url","url": `https://botai.me`,"messenger_extensions": "t
@pelatge
pelatge / fetch-api-examples.md
Created November 26, 2020 17:58 — forked from justsml/fetch-api-examples.md
JavaScript Fetch API Examples
@pelatge
pelatge / GulpReactBrowserifyBabelify.md
Created October 26, 2020 00:36 — forked from lukin0110/GulpReactBrowserifyBabelify.md
Gulp + browserify + babelify + react

Use React with Gulp, Browserify and Babelify. This allows you to use React in jsx & node.js style. It let's you use require('module') in your JavaScript. Babelify will transform the jsx code to JavaScript code.

Development

gulp build-react

This will generate a main.min.js file in the build directory with sourcemaps.

Production

@pelatge
pelatge / README.md
Created May 20, 2020 00:14 — forked from joyrexus/README.md
JavaScript array methods

JavaScript Array Methods

Excerpted from the D3 API docs.

Note esp. usage of the map, filter, and reduce iteration methods. For a nice intro to these methods, see Tom MacWright's talk Beyond the For Loop, and for quick guidance on when to use which iteration method, see this gist.

Mutation Methods

That modify the array:

//package.json
//add new section for engines
"engines": {
"node": "^8.0.0",
"yarn": "^1.2.1"
},
//add 2 new functions to scripts
"scripts": {