Skip to content

Instantly share code, notes, and snippets.

View trungx's full-sized avatar
🚩
Go to 2022

trungx

🚩
Go to 2022
View GitHub Profile
body {
background: black;
color: #d5d4d4;
font-family: Helvetica, Arial, sans-serif;
font-size: 12px;
margin: 0;
overflow-x: auto;
padding: 30px;
}
table {
@trungx
trungx / App\Exceptions\Handler.php
Created March 20, 2018 04:14 — forked from jacurtis/App\Exceptions\Handler.php
How to get filp/whoops to work in Laravel 5.2 or 5.3 - Add this code to your `App\Exceptions\Handler.php` file.
/**
* Create a Symfony response for the given exception.
*
* @param \Exception $e
* @return mixed
*/
protected function convertExceptionToResponse(Exception $e)
{
if (config('app.debug')) {
$whoops = new \Whoops\Run;
@trungx
trungx / heroku_to_github.txt
Created March 24, 2018 09:53 — forked from alterisian/heroku_to_github.txt
How to git your existing heroku app into a new github repo
git remote add github [EMAIL PROTECTED]:myaccount/myapp.git
git remote add heroku [EMAIL PROTECTED]:myapp.git
Then you can do “git push heroku” and “git push github”, or pull, or
From: http://blog.mindtonic.net/using-github-and-heroku-together
@trungx
trungx / sqlmap-cheat-sheet.md
Created April 1, 2018 16:14 — forked from jkullick/sqlmap-cheat-sheet.md
SQLMap Cheat Sheet
# Enumerate databases
sqlmap --dbms=mysql -u "$URL" --dbs

# Enumerate tables
sqlmap --dbms=mysql -u "$URL" -D "$DATABASE" --tables

# Dump table data
sqlmap --dbms=mysql -u "$URL" -D "$DATABASE" -T "$TABLE" --dump
@trungx
trungx / facebook-mass-delete-group-members.js
Created April 1, 2018 16:15 — forked from michaelv/facebook-mass-delete-group-members.js
This javascript removes all users from a facebook group. It works with the new facebook layout. Paste this in the javascript console. Script tested in Firefox. Known issues: 1. when facebook responds slowly, the script might experience hickups.. 2. occasionially, the error 'this user is not a member of the group' pops up.. IMPORTANT: add your ow…
var deleteAllGroupMembers = (function () {
var deleteAllGroupMembers = {};
// the facebook ids of the users that will not be removed.
// IMPORTANT: add your own facebook id here so that the script will not remove yourself!
var excludedFbIds = ['1234','11223344']; // make sure each id is a string!
var usersToDeleteQueue = [];
var scriptEnabled = false;
var processing = false;
deleteAllGroupMembers.start = function() {
@trungx
trungx / revert_a_merge.md
Created April 6, 2018 02:50 — forked from lifuzu/revert_a_merge.md
revert a merge commit that's already pushed to remote branch

The -m option specifies the parent number. This is because a merge commit has more than one parent, and Git does not know automatically which parent was the mainline, and which parent was the branch you want to un-merge.

When you view a merge commit in the output of git log, you will see its parents listed on the line that begins with Merge:

commit 8f937c683929b08379097828c8a04350b9b8e183
Merge: 8989ee0 7c6b236
Author: Ben James <[email protected]>
Date:   Wed Aug 17 22:49:41 2011 +0100

Merge branch 'gh-pages'
@trungx
trungx / sublime-text-3-windows-shortcuts.md
Created April 12, 2018 02:28 — forked from mrliptontea/sublime-text-3-windows-shortcuts.md
Sublime Text 3 - Useful Shortcuts (Windows)

Sublime Text 3 - Useful Shortcuts (Windows)

General

Shortcut Description
Ctrl+Shift+P command prompt
Ctrl+Alt+P switch project
Ctrl+P go to file
Ctrl+G go to line
@trungx
trungx / centered.md
Created April 14, 2018 07:54 — forked from ProjectCleverWeb/centered.md
Example of how to do centered text and images in Githb Flavored Markdown
@trungx
trungx / new.html
Created May 7, 2018 01:37 — forked from isstaif/new.html
Simple website using PHP and MySQL
<form action='newpost.php' method=post>
Title: <input type=text name=title />
Body: <input type=text name=body />
<input type=submit />
</form>
@trungx
trungx / php7_pthreads.sh
Created May 7, 2018 06:57 — forked from giapt/php7_pthreads.sh
PHP7 with Thread
#!/bin/bash
apt-get update
apt install -y libzip-dev bison autoconf build-essential pkg-config git-core \
libltdl-dev libbz2-dev libxml2-dev libxslt1-dev libssl-dev libicu-dev \
libpspell-dev libenchant-dev libmcrypt-dev libpng-dev libjpeg8-dev \
libfreetype6-dev libmysqlclient-dev libreadline-dev libcurl4-openssl-dev
cd $HOME
wget https://github.com/php/php-src/archive/php-7.2.4.tar.gz
tar --extract --gzip --file php-7.2.4.tar.gz