Skip to content

Instantly share code, notes, and snippets.

View wrongbyte's full-sized avatar
🍊
I like orange juice

wrongbyte

🍊
I like orange juice
View GitHub Profile
@nicholaspufal
nicholaspufal / programming_terms.md
Created March 20, 2011 16:40
Termos, teorias e tΓ©cnicas comumente usados em programaΓ§Γ£o.

Heap e Stack (segmentos da memΓ³ria)

A memΓ³ria possui 3 segmentos: text/code segment, stack segment e heap segment.

  • Text/code segment: onde o cΓ³digo compilado do programa reside. Γ‰ a representaΓ§Γ£o do programa em linguagem de mΓ‘quina com as operaΓ§Γ΅es que devem ser realizadas, incluindo todas as funΓ§Γ΅es, tanto as definidas pelo usuΓ‘rio, como as do sistema.

  • Stack segment: espaΓ§o onde variΓ‘veis automΓ‘ticas que estΓ£o dentro de funΓ§Γ΅es serΓ£o alocadas. Usa o conceito de FIFO (first in, first out), ou seja, dados sΓ£o alocados e desalocados por apenas uma das "pontas", o Top do stack. Ex: todas as variΓ‘veis declaradas no main() entram no stack. Se main() chamar func1(), func1() - junto com parΓ’metros que tiver - passa para o Top do stack. Quando func1() retornar algum valor (return), ela Γ© desalocada do stack. Evidente que ficarΓ‘ lixo nessa Γ‘rea da memΓ³ria, deixado por um prΓ©vio uso.

@jexchan
jexchan / multiple_ssh_setting.md
Created April 10, 2012 15:00
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "[email protected]"
@debloper
debloper / xrandr.sh
Last active September 13, 2024 22:40
Add system unrecognized but monitor supported resolution in X
#!/bin/bash
# Copyright (c) 2021 Soumya Deb <[email protected]>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
@gschema
gschema / intro.md
Last active November 27, 2023 04:35
Basic JavaScript MVC Implementation

Basic JavaScript MVC Implementation

Despite being derived from classical MVC pattern JavaScript and the environment it runs in makes Javascript MVC implementation have its own twists. Lets see how typical web MVC functions and then dive into simple, concrete JavaScript MVC implementation.

How Web MVC typically works

Typical server-side MVC implementation has one MVC stack layered behind the singe point of entry. This single point of entry means that all HTTP requests, e.g. http://www.example.com or http://www.example.com/whichever-page/ etc., are routed, by a server configuration, through one point or, to be bold, one file, e.g. index.php.

At that point, there would be an implementation of Front Controller pattern which analyzes HTTP request (URI at first place) and based on it decides which class (Controller) and its method (Action) are to be invoked as a response to the request (method is name for function and member is name for a variable when part of the class/object).

@tedmiston
tedmiston / nodejs-tcp-example.js
Last active April 1, 2025 08:06
Node.js TCP client and server example
/*
In the node.js intro tutorial (http://nodejs.org/), they show a basic tcp
server, but for some reason omit a client connecting to it. I added an
example at the bottom.
Save the following server in example.js:
*/
var net = require('net');
@rxaviers
rxaviers / gist:7360908
Last active April 29, 2025 17:19
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: πŸ˜„ :smile: πŸ˜† :laughing:
😊 :blush: πŸ˜ƒ :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
πŸ˜† :satisfied: 😁 :grin: πŸ˜‰ :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: πŸ˜€ :grinning:
πŸ˜— :kissing: πŸ˜™ :kissing_smiling_eyes: πŸ˜› :stuck_out_tongue:
@staltz
staltz / introrx.md
Last active April 29, 2025 08:33
The introduction to Reactive Programming you've been missing
@max-mapper
max-mapper / 0.md
Last active March 7, 2025 13:39
JS hoisting by example

JavaScript function hoisting by example

Below are many examples of function hoisting behavior in JavaScript. Ones marked as works successfuly print 'hi!' without errors.

To play around with these examples (recommended) clone them with git and execute them with e.g. node a.js

Notes on hoisting

(I may be using incorrect terms below, please forgive me)

@acdlite
acdlite / flux.js
Last active October 7, 2021 17:19
A Redux-like Flux implementation in <75 lines of code
/**
* Basic proof of concept.
* - Hot reloadable
* - Stateless stores
* - Stores and action creators interoperable with Redux.
*/
import React, { Component } from 'react';
export default function dispatch(store, atom, action) {
@VictorTaelin
VictorTaelin / promise_monad.md
Last active October 24, 2024 01:25
async/await is just the do-notation of the Promise monad

async/await is just the do-notation of the Promise monad

CertSimple just wrote a blog post arguing ES2017's async/await was the best thing to happen with JavaScript. I wholeheartedly agree.

In short, one of the (few?) good things about JavaScript used to be how well it handled asynchronous requests. This was mostly thanks to its Scheme-inherited implementation of functions and closures. That, though, was also one of its worst faults, because it led to the "callback hell", an seemingly unavoidable pattern that made highly asynchronous JS code almost unreadable. Many solutions attempted to solve that, but most failed. Promises almost did it, but failed too. Finally, async/await is here and, combined with Promises, it solves the problem for good. On this post, I'll explain why that is the case and trace a link between promises, async/await, the do-notation and monads.

First, let's illustrate the 3 styles by implementing