Skip to content

Instantly share code, notes, and snippets.

View lelinhtinh's full-sized avatar
🤤
Slimming failure

Thành Thân Thiện lelinhtinh

🤤
Slimming failure
  • Da nang, Vietnam
  • 21:43 (UTC +07:00)
View GitHub Profile
@sathishmanohar
sathishmanohar / recover_grub_2.sh
Created May 21, 2012 17:15
Recovering GRUB 2 Boot Loader - Steps and Instructions
# This is text format of the instructions shown in the below Youtube video
# http://www.youtube.com/watch?v=ajs9rO5upZA
# First get a ubuntu Live CD or USB Stick and boot from it
# Check all the Hard disk and Partitions using following command
sudo fdisk -l # Now take a note of the partition, on which linux is installed which may be like: /dev/sda1
# 3. Mount the partition where you need to install GRUB 2 (Hard disk partition)
# Now the file system appears in nautaulis and command line is not file system of Hard disk
@arantius
arantius / grant-none-shim.js
Last active May 21, 2022 14:47
Greasemonkey "@grant none" compatibility shim.
/*
The MIT License (MIT)
Copyright (c) 2014 Anthony Lieuallen
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
// if Navigation Timing is not supported, fallback to Date.naw() called on start (sufficient in many cases)
// Date.now is also polyfilled
(function(p){
if(!Date.now)
Date.now = function(){return +new Date};
if (!p.now){
var start = (p.timing && p.timing.navigationStart) || Date.now();
p.now = function now(){
return Date.now() - start;
@yyx990803
yyx990803 / starcounter.js
Last active October 22, 2024 18:57
Count your total stars!
var https = require('https'),
user = process.argv[2],
opts = parseOpts(process.argv.slice(3))
request('/users/' + user, function (res) {
if (!res.public_repos) {
console.log(res.message)
return
}
var pages = Math.ceil(res.public_repos / 100),
@aaronk6
aaronk6 / jquery-ajax-blob-arraybuffer.js
Last active June 1, 2020 19:10 — forked from SaneMethod/jquery-ajax-blob-arraybuffer.js
This fork supports request headers and returns text data if the request fails.
/**
* Register ajax transports for blob send/recieve and array buffer send/receive via XMLHttpRequest Level 2
* within the comfortable framework of the jquery ajax request, with full support for promises.
*
* Notice the +* in the dataType string? The + indicates we want this transport to be prepended to the list
* of potential transports (so it gets first dibs if the request passes the conditions within to provide the
* ajax transport, preventing the standard transport from hogging the request), and the * indicates that
* potentially any request with any dataType might want to use the transports provided herein.
*
* Remember to specify 'processData:false' in the ajax options when attempting to send a blob or arraybuffer -
@mul14
mul14 / README.md
Last active February 10, 2023 00:55
Simple Laravel Search Trait

Usage

Put SearchTrait.php in app directory. Then use SearchTrait in your model, like so

use App\SearchTrait;
use Illuminate\Database\Eloquent\Model;

class Article extends Model 
{
@bftanase
bftanase / secure_link.php
Last active July 19, 2024 16:14
generate URL for nginx secure_link
@ilkereroglu
ilkereroglu / simply-sending-e-mails-with-mailx.md
Created September 22, 2015 21:53
How To Send E-Mail On CentOS 7

Installing mailx

yum -y update
yum install -y mailx

We can now start sending e-mails using

@ccloli
ccloli / GM_download_polyfill.js
Last active February 21, 2021 14:26
GM_download polyfill, a polyfill to make your userscript supports GM_download
/*
* GM_download polyfill
*
* @description A polyfill to make your userscript supports GM_download
* @author ccloli
* @version 1.0
*/
// to use this polyfill, you must add "@grant GM_xmlhttpRequest" at userscript metadata block
@BlinkoWang
BlinkoWang / FileUtil.java
Last active August 21, 2024 09:33
convert byte count to human readable
/**
* SI BINARY
* 0: 0 B 0 B
* 27: 27 B 27 B
* 999: 999 B 999 B
* 1000: 1.0 kB 1000 B
* 1023: 1.0 kB 1023 B
* 1024: 1.0 kB 1.0 KiB
* 1728: 1.7 kB 1.7 KiB
* 110592: 110.6 kB 108.0 KiB