Skip to content

Instantly share code, notes, and snippets.

@taisang1996
taisang1996 / magiamgia.js
Created May 18, 2019 13:22
tắt mở trang mới và hiển thị mã giảm giá
// ==UserScript==
// @include http://*
// @include https://*
// @run-at document-end
// ==/UserScript==
if (window.location.host === 'bloggiamgia.vn') {
unsafeWindow.open = function () { }
document.querySelectorAll('.polyxgo_get_coupon').forEach(element => {
<?php
$url = "http://www.phimmoi.net/phim/huyen-thoai-cua-ngay-mai-phan-4-7585/xem-phim.html";
$ch = curl_init();
{
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
@taisang1996
taisang1996 / iqtest.vn.js
Last active July 20, 2017 08:41
Tự động trả lời câu hỏi iqtest.vn iqtest.edu.vn
// Tự trả lời
store.get('dapan').forEach((q, i) => {
let idcauhoi = q.IDQues;
let iddapan = q.IDAns;
let $select;
// Khoanh vùng đáp án hình đúng
if (q.AnswerType == 0) {
$select = $(`[onclick="luudapan(${idcauhoi},${iddapan},this)"]`);
$select.css({'border':'1px solid red'});
<?php
/**
* Make phone clickable
* @param string $input
* @param boolean $span
* @return string
*/
function makePhoneClickable($input, $span = false) {
$regex = '/(?!\s)[\d\s\.\,\(\)\+]{9,30}\b/';
$formatLink = function($matches) {
<?php
/**
* Make email clickable
*
* @author Nguyen Tan Tai <taisang1996@gmail.com>
* @param string Input text
* @param boolean Want add <span> inside <a>?
* @return string Replaced string format with link or link span
*/
// just for fun
// fb.com/TaiSangVN
document.head.innerHTML = `<style>* {
margin: 0;
padding: 0;
}
.hacked {
background: black;
color: lime;
@taisang1996
taisang1996 / index.php
Created April 18, 2017 04:13
Bóc tách dữ liệu zing
<?php
/*
* Cài đặt và chạy như nào?
*
* $ composer require fapbot/goutte
* $ php index.php
*
* Tham khảo thêm :
* - https://github.com/FriendsOfPHP/Goutte
@taisang1996
taisang1996 / curl_phimmoi.php
Created February 15, 2017 14:26
curl phimmoi.net
<?php
function fetchSource($url)
{
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");
@taisang1996
taisang1996 / scraping_link_thegioididong.js
Created February 11, 2017 09:15
Scraping link thegioididong with ajax :)
@taisang1996
taisang1996 / scraping_link_thegioididong.js
Created February 11, 2017 09:15
Scraping link thegioididong with ajax :)