Skip to content

Instantly share code, notes, and snippets.

View RDCH106's full-sized avatar
Partially offline. No time...

Rubén de Celis Hernández RDCH106

Partially offline. No time...
View GitHub Profile
@iBet7o
iBet7o / description.md
Created January 19, 2015 00:00
Color del texto en scripts bash

Código de colores

Black        0;30     Dark Gray     1;30
Blue         0;34     Light Blue    1;34
Green        0;32     Light Green   1;32
Cyan         0;36     Light Cyan    1;36
Red          0;31     Light Red     1;31
Purple       0;35     Light Purple  1;35
Brown/Orange 0;33     Yellow        1;33

Light Gray 0;37 White 1;37

@Integralist
Integralist / Python TCP Client Example.py
Created September 18, 2016 15:07
Python TCP Client Server Example
import socket
hostname, sld, tld, port = 'www', 'integralist', 'co.uk', 80
target = '{}.{}.{}'.format(hostname, sld, tld)
# create an ipv4 (AF_INET) socket object using the tcp protocol (SOCK_STREAM)
client = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
# connect the client
# client.connect((target, port))
@iBet7o
iBet7o / description.md
Created January 19, 2015 01:01
Script bash para renombrar directorios y archivos

Dependencias

  • Descargar archivo flash.sh.
  • Descargar archivo rename.sh que se encuentra mas abajo.

Instalación

Modificar los permisos del archivo rename.sh

@facontidavide
facontidavide / factory.cpp
Last active November 16, 2022 09:16
Factory pattern in C++
#include <iostream>
#include <unordered_map>
#include <functional>
#include <vector>
// Base class
class Shape {
public:
virtual void draw() = 0;
};
@pies
pies / ExcelFormulas.js
Created November 29, 2012 04:55
Few Excel formulas - PMT, PPMT, XIRR - expressed in Javascript
/* Based on
* - EGM Mathematical Finance class by Enrique Garcia M. <egarcia@egm.co>
* - A Guide to the PMT, FV, IPMT and PPMT Functions by Kevin (aka MWVisa1)
*/
var ExcelFormulas = {
PVIF: function(rate, nper) {
return Math.pow(1 + rate, nper);
},
@amirasaran
amirasaran / BaseThreading
Created October 27, 2016 06:36
Python threading with callback function (callback function run after thread is finished)
import time
import threading
class BaseThread(threading.Thread):
def __init__(self, callback=None, callback_args=None, *args, **kwargs):
target = kwargs.pop('target')
super(BaseThread, self).__init__(target=self.target_with_callback, *args, **kwargs)
self.callback = callback
self.method = target
@ummahusla
ummahusla / git-overwrite-branch.sh
Last active February 25, 2024 00:06 — forked from brev/git-overwrite-branch.sh
Git overwrite branch with another branch
# overwrite master with contents of feature branch (feature > master)
git checkout feature # source name
git merge -s ours master # target name
git checkout master # target name
git merge feature # source name
// ==UserScript==
// @name EmuParadise Download Workaround - 1.1.1
// @version 1.1.2
// @description Replaces the download button link with a working one
// @author Eptun
// @match https://www.emuparadise.me/*/*/*
// @require http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js
// @grant none
// ==/UserScript==
@jonlabelle
jonlabelle / crlf.py
Last active March 12, 2024 05:44
Replace CRLF (windows) line endings with LF (unix) line endings in files.
#!/usr/bin/env python
"""Replace line breaks, from one format to another."""
from __future__ import print_function
import argparse
import glob
import os
import sys
@heldr
heldr / addfont.cmd
Last active March 25, 2024 14:14
add windows fonts by command line
REM http://www.msfn.org/board/topic/119612-how-to-install-a-font-via-the-command-line/
@ECHO OFF
TITLE Adding Fonts..
REM Filename: ADD_Fonts.cmd
REM Script to ADD TrueType and OpenType Fonts for Windows
REM By Islam Adel
REM 2012-01-16
REM How to use: