Skip to content

Instantly share code, notes, and snippets.

View minhphuc429's full-sized avatar
💭
I may be slow to respond.

Phuc Nguyen Minh minhphuc429

💭
I may be slow to respond.
View GitHub Profile
@crawler
crawler / what_i_serialize.rb
Last active January 10, 2024 16:59
WHAT I SERIALIZE?
# frozen_string_literal: true
###############################################################################################
# WHAT I SERIALIZE? #
###############################################################################################
# This scrip can help you to find what object types you need to witelist after CVE-2022-32224 update
# AD: If you using StimulusJS then checkout my gem stimulus_tag_helper
# https://rubygems.org/gems/stimulus_tag_helper
# https://github.com/crawler/stimulus_tag_helper
@firatkucuk
firatkucuk / delete-slack-messages.js
Last active July 1, 2024 15:26
Deletes slack public/private channel messages, private chat messages and channel thread replies.
#!/usr/bin/env node
// Channel ID is on the the browser URL.: https://mycompany.slack.com/messages/MYCHANNELID/
// Pass it as a parameter: node ./delete-slack-messages.js CHANNEL_ID
// CONFIGURATION #######################################################################################################
const token = 'SLACK TOKEN';
// Legacy tokens are no more supported.
// Please create an app or use an existing Slack App
@ivanvermeyen
ivanvermeyen / !NOTE.md
Last active March 15, 2023 05:25
Setup a Laravel Storage driver with Google Drive API
@joseph-tran-tn
joseph-tran-tn / new_gist_file.js
Last active August 15, 2018 17:12
JQuery thật tuyệt nhưng đừng quên JavaScript
jQuery là một thư viện javascript rất phổ biến, nó phổ biến đến mức một số bạn bè mình quen viết jQuery mà không biết gì về javascript.
Có thể nói jQuery giống như một cô nàng hiểu tâm lý và rất biết chiều chuộng khách, khách cần gì là có đó ngay, đi từ A tới Z luôn.
Tuy nhiên cái gì cũng có hai mặt của nó, những mặt chưa được mình sẽ nói ở cuối bài. Bài viết này cũng không nhằm mục đích khuyên các bạn chia tay với cô nàng jQuery, nhưng hãy thử một ngày xa nàng xem sao, biết đâu bạn nhận ra rằng cuộc sống độc thân tuyệt vời biết bao.
Một số ví dụ no-jQuery
1. Lắng nghe sự kiện
Nhiều developer có thói quen bao toàn bộ code js bởi $(document).ready():
@rkttu
rkttu / iptimeReboot.cs
Last active June 6, 2023 09:20
IPtime router reboot C# application code
// You can compile this code with csc.exe or any C# supported shell.
/*
* Copyright (c) 2016 ClouDeveloper
*
* 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
@thachpham92
thachpham92 / gist:d57b18cf02e3550acdb5
Last active March 1, 2024 17:10
Tất cả các tham số trong WP_Query
// Source: https://gist.github.com/luetkemj/2023628
// Xem hướng dẫn WP_Query toàn tập: http://goo.gl/kRpzTz
<?php
$args = array(
//////Author Parameters - Tham số lấy bài viết theo tác giả
//http://codex.wordpress.org/Class_Reference/WP_Query#Author_Parameters
'author' => '1,2,3,', //(int) - Các ID tác giả cần lấy bài viết (thêm dấu - vào để loại trừ tác giả, ví dụ: -14, -20)
'author_name' => 'luetkemj', //(string) - Lấy bài viết dựa theo tên nick name của tác giả
'author__in' => array( 2, 6 ), //(array) - Lấy bài dựa theo ID của tác giả
@growdev
growdev / gist:b68e35b5c6e0856bdbf1
Created March 19, 2015 19:01
Delete all WooCommerce Products with wp-cli
wp post list --field=ID --post_type=product | xargs wp post delete --force
@amochohan
amochohan / 01_Laravel 5 Simple ACL manager_Readme.md
Last active July 16, 2024 18:08
Laravel 5 Simple ACL - Protect routes by an account / role type

#Laravel 5 Simple ACL manager

Protect your routes with user roles. Simply add a 'role_id' to the User model, install the roles table and seed if you need some example roles to get going.

If the user has a 'Root' role, then they can perform any actions.

Installation

Simply copy the files across into the appropriate directories, and register the middleware in App\Http\Kernel.php

@wrey75
wrey75 / JSONUtil.php
Created December 3, 2014 22:06
A JSON Diff object
<?php
/**
* This class works on arrays, not on JSON strings
* directly. You have to use json_encode/json_decode
* for doing this.
*
* @author wrey75@gmail.com
*
*/
@irazasyed
irazasyed / ampps-mysql-fix.md
Last active April 27, 2024 07:41
AMPPS MySQL not working, Solution!

AMPPS MySQL not working, Solution!

  1. Open Ampps Application -> MySQL Tab -> Configuration.

  2. In [mysqld] section, add the following line: innodb_force_recovery = 1

  3. Save the file and try starting MySQL

  4. Remove that line which you just added and Save.