Skip to content

Instantly share code, notes, and snippets.

View xnohat's full-sized avatar
💭
Coding like machine

Hong Phuc Nguyen xnohat

💭
Coding like machine
View GitHub Profile
@xnohat
xnohat / saas.md
Created August 23, 2017 16:19
List of SaaS (Software as a Service) for lazy Developer

"Search first, Code later" - xnohat

This is a unshorted list of SaaS (Software as a Service) for lazy Developer.

@xnohat
xnohat / facebook-mass-delete-group-members.js
Last active August 23, 2017 16:21 — 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() {
@xnohat
xnohat / websocket.html
Created April 9, 2018 18:30 — forked from dg/websocket.html
WebSocket communication between PHP and single client
<!doctype html>
<script>
if ("WebSocket" in window) {
var ws = new WebSocket("ws://127.0.0.1:31339");
ws.onopen = function() {
console.log('connected');
};
ws.onerror = function(e) {
@xnohat
xnohat / Clipboard.js
Created April 13, 2018 20:11 — forked from rproenca/Clipboard.js
Copy text to clipboard using Javascript. It works on Safari (iOS) and other browsers.
window.Clipboard = (function(window, document, navigator) {
var textArea,
copy;
function isOS() {
return navigator.userAgent.match(/ipad|iphone/i);
}
function createTextArea(text) {
textArea = document.createElement('textArea');
@xnohat
xnohat / index.html
Created May 12, 2018 08:43 — forked from getsetbro/index.html
d3.js bubbles with zoom & dblclick to select one
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<title>Bubble Chart</title>
<link type="text/css" rel="stylesheet" href="bubble.css"/>
<style type="text/css">body{margin:0;font: 10px sans-serif;}</style>
</head>
<body>
<div id="chart"></div>
@xnohat
xnohat / bitsadmin.md
Created May 15, 2018 16:37 — forked from rosswd/bitsadmin.md
Use bitsadmin to download via the command line on Windows 7 (8?)

Download via the command line on Windows 7

If you want to test your connection or have some other reason to use the command line to download a file, this is how.

See http://superuser.com/a/284147 for more information.

Open cmd.exe and use this format:

bitsadmin /transfer debjob /download /priority normal http://cdimage.debian.org/debian-cd/current-live/i386/iso-hybrid/debian-live-8.7.1-i386-xfce-desktop.iso D:\Users\[Username]\Downloads\debian-live-8.7.1-i386-xfce-desktop.iso
@xnohat
xnohat / dedupe.ps1
Created September 30, 2018 12:28
Removing duplicate entries in NuGet packages.config
# Paste this entire script into NuGet Package Manager Console with an open solution in Visual Studio.
# This script will locate projects with duplicate dependencies in packages.config and remove them.
Function Get-Duplicate {
param([Parameter(Position=0, Mandatory=$true, ValueFromPipeline=$true)]$array, [switch]$count)
begin {
$hash = @{}
}
process {
$array | %{ $hash[$_] = $hash[$_] + 1 }
@xnohat
xnohat / ntfs-file-system-increase-speed-performance.com
Created March 10, 2019 20:21 — forked from p3x-robot/ntfs-file-system-increase-speed-performance.com
🚄 This is a simple utility to increase the NTFS performance by turning off some NTFS features that are not so used by now (or not so important).
rem execute as an Administrator
rem based on http://www.windowsdevcenter.com/pub/a/windows/2005/02/08/NTFS_Hacks.html
ram based on https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-2000-server/cc938961(v=technet.10)
rem http://archive.oreilly.com/cs/user/view/cs_msg/95219 (some installers need 8dot3 filenames)
rem disable 8dot3 filenames
ram Warning: Some applications such as incremental backup utilities rely on this update information and do not function correctly without it.
fsutil behavior set disable8dot3 1
@xnohat
xnohat / chmodmautic.sh
Created August 21, 2020 07:49
File Permission for Mautic install
cd /var/www/mautic
mkdir app/spool/
find . -type d -exec chmod 755 {} \;
find . -type f -exec chmod 644 {} \;
chmod -R g+w app/cache/
chmod -R g+w app/logs/
chmod -R g+w app/config/
chmod -R g+w media/files/
chmod -R g+w media/images/
chmod -R g+w translations/
@xnohat
xnohat / sysctl.conf
Created October 8, 2020 13:44 — forked from hendra/sysctl.conf
Optimizing Ubuntu 16.04 Server
### IMPROVE SYSTEM MEMORY MANAGEMENT ###
# Increase size of file handles and inode cache
fs.file-max = 2097152
# Do less swapping
vm.swappiness=10
vm.vfs_cache_pressure = 50
vm.dirty_ratio = 60
vm.dirty_background_ratio = 2