Skip to content

Instantly share code, notes, and snippets.

View hdhoang's full-sized avatar
💭
safe

hdhoang hdhoang

💭
safe
View GitHub Profile
@glfmn
glfmn / .pre-commit.sh
Last active January 23, 2024 06:46
pre-commit Test Automation Script
#!/usr/bin/env sh
# pre-commit.sh
# Colors
RED='\033[1;31m'
GREEN='\033[1;32m'
YELLOW='\033[1;33m'
NC='\033[0m'
BOLD='\033[1m'
@gobinathm
gobinathm / shallow_update_git.md
Created March 6, 2017 18:24
Fix for Remote rejected shallow update not allowed after changing Git remote URL

Some Time there is a shallow update not allowed issue in your cloned GIT repo.

This means that you have to unshallow your repository. To do so you will need to add your old remote again.

git remote add origin <path-to-old-remote> After that we use git fetch to fetch the remaining history from the old remote (as suggested in this answer).

git fetch --unshallow origin And now you should be able to push into your new remote repository.

@GreenLightning
GreenLightning / 19392494.lua
Created June 16, 2015 19:00
TIS-100 PRIME DETECTOR SPECIFICATION
-- For anyone who liked the PRIME DETECTOR puzzle included in some of the early access
-- builds of TIS-100...
-- INSTALLATION: Copy everything in this file. Open TIS-100. Go to the SPECIFICATION
-- EDITOR. Click on IMPORT SPECIFICATION FROM CLIPBOARD. Done!
-- The function get_name() should return a single string that is the name of the puzzle.
--
function get_name()
return "PRIME DETECTOR"
@Edward-H
Edward-H / cobol-mode.el
Last active May 2, 2024 14:20
An Emacs mode for COBOL code. It features syntax highlighting for most modern dialects, indentation, support for free- and fixed-format code and code skeletons.
;;; cobol-mode.el --- Mode for editing COBOL code -*- lexical-binding: t; -*-
;; Copyright (C) 2013-2017 Edward Hart
;; Author: Edward Hart <edward.dan.hart@gmail.com>
;; Maintainer: Edward Hart
;; Version: 1.0.0
;; Created: 9 November 2013
;; Keywords: languages
@nicky-zs
nicky-zs / memcpy.c
Created November 19, 2013 06:31
One way to solve the glibc compatibility problem. In my case, when building a program with libthrift.a on linux with glibc version 2.15, ld always links memcpy@GLIBC_2.14 which cannot be found on systems with glibc version < 2.14. So, use this file to define a symbol __wrap_memcpy and use -Wl,--wrap=memcpy to tell ld using this symbol when meeti…
#include <string.h>
void *__memcpy_glibc_2_2_5(void *, const void *, size_t);
asm(".symver __memcpy_glibc_2_2_5, memcpy@GLIBC_2.2.5");
void *__wrap_memcpy(void *dest, const void *src, size_t n)
{
return __memcpy_glibc_2_2_5(dest, src, n);
}