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
// ==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
@bskim45
bskim45 / singleton.cpp
Created December 27, 2016 02:33
Simple C++ Singleton Example
// C++ 11 way, thread-safe version, guaranteed to be destroyed.
// For further details, see §6.7 [stmt.dcl] p4 of C++ 11 standard
class Singleton
{
public:
static Singleton& instance();
Singleton(Singleton const&) = delete; // Don't forget to disable copy
void operator=(Singleton const&) = delete; // Don't forget to disable copy
@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
@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))
@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;
};
@noelboss
noelboss / git-deployment.md
Last active April 25, 2024 10:38
Simple automated GIT Deployment using Hooks

Simple automated GIT Deployment using GIT Hooks

Here are the simple steps needed to create a deployment from your local GIT repository to a server based on this in-depth tutorial.

How it works

You are developing in a working-copy on your local machine, lets say on the master branch. Most of the time, people would push code to a remote server like github.com or gitlab.com and pull or export it to a production server. Or you use a service like deepl.io to act upon a Web-Hook that's triggered that service.

@mlocati
mlocati / win10colors.cmd
Last active January 19, 2024 14:18
ANSI Colors in standard Windows 10 shell
@echo off
setlocal
call :setESC
cls
echo %ESC%[101;93m STYLES %ESC%[0m
echo ^<ESC^>[0m %ESC%[0mReset%ESC%[0m
echo ^<ESC^>[1m %ESC%[1mBold%ESC%[0m
echo ^<ESC^>[4m %ESC%[4mUnderline%ESC%[0m
@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
@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