Skip to content

Instantly share code, notes, and snippets.

View RenatoExpert's full-sized avatar
🎯
Focusing

Renato Araujo RenatoExpert

🎯
Focusing
View GitHub Profile
@katylava
katylava / git-selective-merge.md
Last active February 27, 2024 10:18
git selective merge

Update 2022: git checkout -p <other-branch> is basically a shortcut for all this.

FYI This was written in 2010, though I guess people still find it useful at least as of 2021. I haven't had to do it ever again, so if it goes out of date I probably won't know.

Example: You have a branch refactor that is quite different from master. You can't merge all of the commits, or even every hunk in any single commit or master will break, but you have made a lot of improvements there that you would like to bring over to master.

Note: This will not preserve the original change authors. Only use if necessary, or if you don't mind losing that information, or if you are only merging your own work.

@PaulKinlan
PaulKinlan / gist:4160675
Created November 28, 2012 11:46
Encapsulating Request Animation Frame
/*
Javascript is a funny thing.
Here are two things that will hit you with requestAnimationFrame
1) If you alias the window.requestAnimationFrame function on to anything other
than a window object, you get an Illegal Invocation Error.
You can solve this by using call() with the window object set.
@tbereau
tbereau / acetone.pdb
Created April 19, 2013 07:31
Acetone PDB
ATOM 1 C1 LIG O 1 -1.572 -1.974 -1.412 1.00 0.00 O1
ATOM 2 C2 LIG O 1 -0.873 -1.710 -0.085 1.00 0.00 O1
ATOM 3 O1 LIG O 1 0.006 -0.848 0.086 1.00 0.00 O1
ATOM 4 C3 LIG O 1 -1.406 -2.648 0.972 1.00 0.00 O1
ATOM 5 H1 LIG O 1 -1.800 -3.000 -1.522 1.00 0.00 O1
ATOM 6 H2 LIG O 1 -2.474 -1.426 -1.590 1.00 0.00 O1
ATOM 7 H3 LIG O 1 -0.905 -1.801 -2.305 1.00 0.00 O1
ATOM 8 H4 LIG O 1 -2.463 -2.735 1.032 1.00 0.00 O1
ATOM 9 H5 LIG O 1 -1.069 -3.613 0.608 1.00 0.00 O1
ATOM 10 H6 LIG O 1 -1.093 -2.515 1.991 1.00 0.00 O1
@mgechev
mgechev / basic-tcp-server.dart
Created June 17, 2013 15:55
Basic TCP server in Dart
import 'dart:core';
import 'dart:async';
import 'dart:io';
void startServer() {
Future<ServerSocket> serverFuture = ServerSocket.bind('0.0.0.0', 55555);
serverFuture.then((ServerSocket server) {
server.listen((Socket socket) {
socket.listen((List<int> data) {
String result = new String.fromCharCodes(data);
@erkobridee
erkobridee / medicina_software_livre.md
Last active June 24, 2024 04:28
listagem de ferramentas de software livre para profissionais de medicina

Profissionais Liberais - Medicina

Ferramentas

Modelo Comercial : Software Livre

OpenMRS

Descrição : É uma plataforma que permite a construção de um sistema personalizado de registros médicos sem precisar de conhecimentos em programação (claro que o conhecimento de análises médicas e sistemas é necessário). O sistema é baseado em uma estrutura conceitual de banco de dados que armazena dados do paciente e registros médicos, permite a exportação de dados para planilhas, possui meios de segurança para os dados clínicos dos pacientes, criação de relatórios, e outras funções. É um projeto libre muito utilizado nos países pobres para o acompanhamento de epidemias e está disponível para Linux, Windows e Mac OS.

@Xaekai
Xaekai / ipc.example.js
Created July 11, 2016 18:12
Example of Interprocess communication in Node.js through a UNIX domain socket
/*
**
** Example of Interprocess communication in Node.js through a UNIX domain socket
**
** Usage:
** server> MODE=server node ipc.example.js
** client> MODE=client node ipc.example.js
**
*/
@kuzetsa
kuzetsa / ntp.conf
Last active January 14, 2023 04:29
this configuration is what I'm using for OpenVZ
# OpenVZ is cheap, but the clock is disciplined by host
server 127.127.1.0 minpoll 3 maxpoll 3 prefer
fudge 127.127.1.0 stratum 1
# ntp_adjtime: Operation not permitted
disable kernel
rlimit memlock 128
mru maxmem 6912 maxage 32 initalloc 1 initmem 64 incalloc 256 incmem 64
@maliarslan
maliarslan / node-app-as-service-on-ubuntu.md
Last active May 26, 2024 10:19
Run Node.js application as service on Ubuntu 16.04

Assuming that you have already installed Node.js on your system. If you haven't visit https://nodejs.org/en/download/package-manager/

First we need to create a service file into /lib/systemd/system to introduce our service.

So, with your favorite editor, open up a new file there with;

sudo nano /lib/systemd/system/mygreatestapp.service

Put the following contents in it;

[Unit]
@chriscandy
chriscandy / install-arch-linux-using-efi-and-grub.md
Last active July 26, 2024 14:37
Install Arch Linux using EFI and GRUB

Installing Arch linux with EFI

  1. Change keyboard layout:

    • loadkeys no
  2. Verify boot mode:

    • ls /sys/firmware/efi/efivars (If the directory exist your computer supports EFI)
  3. Ping some site on the Internet to verify connection:

  • ping archlinux.org
@mauler
mauler / http_server_auth.py
Last active June 25, 2024 20:57 — forked from fxsjy/SimpleAuthServer.py
Python3 http.server supporting basic HTTP Auth (username/password)
# Extended python -m http.serve with --username and --password parameters for
# basic auth, based on https://gist.github.com/fxsjy/5465353
from functools import partial
from http.server import SimpleHTTPRequestHandler, test
import base64
import os
class AuthHTTPRequestHandler(SimpleHTTPRequestHandler):