Skip to content

Instantly share code, notes, and snippets.

View hnq90's full-sized avatar
🎯
Focusing

Huy Nguyen Quang hnq90

🎯
Focusing
View GitHub Profile
@otobrglez
otobrglez / jaccard_recommendation.rb
Last active April 2, 2024 17:51
Simple recommendation system written in Ruby based on Jaccard index.
# Simple Recommendation Engine in Ruby
# Visit: http://otobrglez.opalab.com
# Author: Oto Brglez <[email protected]>
class Book < Struct.new(:title)
def words
@words ||= self.title.gsub(/[a-zA-Z]{3,}/).map(&:downcase).uniq.sort
end
@christopher-hopper
christopher-hopper / vm-resize-hard-disk.md
Last active August 15, 2024 15:16
Resize a Hard Disk for a Virtual Machine provisioned using Vagrant from a Linux base box to run using VirutalBox.

Resize a Hard Disk for a Virtual Machine

Our Virtual Machines are provisioned using Vagrant from a Linux base box to run using VirutalBox. If the Hard Disk space runs out and you cannot remove files to free-up space, you can resize the Hard Disk using some VirtualBox and Linux commands.

Some assumptions

The following steps assume you've got a set-up like mine, where:

@vertexclique
vertexclique / cracking.md
Last active July 7, 2025 08:25
Cracking guide for Sublime Text 3 Build 3059 / 3065 ( Mac / Win x86_64 / Windows x86 / Linux x64 / Linux x86 )

MacOS

Build 3059

MD5: 59bab8f71f8c096cd3f72cd73851515d

Rename it to: Sublime Text

Make it executable with: chmod u+x Sublime\ Text

@hnq90
hnq90 / grape_routes.rb
Last active August 29, 2015 13:57
List all routes of grape app and export to text file
desc 'Generate API Desc'
task :api_desc => :environment do
=begin
___ ___ ___ ___ ___ ___ ________ ________
|\ \|\ \|\ \|\ \ |\ \ / /|\ ___ \|\ __ \
\ \ \\\ \ \ \\\ \ \ \ \/ / | \ \\ \ \ \ \|\ \
\ \ __ \ \ \\\ \ \ \ / / \ \ \\ \ \ \ \\\ \
\ \ \ \ \ \ \\\ \ \/ / / \ \ \\ \ \ \ \\\ \
\ \__\ \__\ \_______\__/ / / \ \__\\ \__\ \_____ \
\|__|\|__|\|_______|\___/ / \|__| \|__|\|___| \__\
@graphicbeacon
graphicbeacon / chat-server.js
Last active June 17, 2025 15:16
A simple TCP chat server with NodeJS, based on the example provided by creationix.
var net = require('net');
var sockets = [];
var port = 8000;
var guestId = 0;
var server = net.createServer(function(socket) {
// Increment
guestId++;
socket.nickname = "Guest" + guestId;
@soheilhy
soheilhy / nginxproxy.md
Last active July 5, 2025 15:29
How to proxy web apps using nginx?

Virtual Hosts on nginx (CSC309)

When hosting our web applications, we often have one public IP address (i.e., an IP address visible to the outside world) using which we want to host multiple web apps. For example, one may wants to host three different web apps respectively for example1.com, example2.com, and example1.com/images on the same machine using a single IP address.

How can we do that? Well, the good news is Internet browsers

@tbrianjones
tbrianjones / Inflect.php
Last active February 21, 2024 21:28
A PHP Class for converting English words between Singular and Plural.
<?php
// original source: http://kuwamoto.org/2007/12/17/improved-pluralizing-in-php-actionscript-and-ror/
/*
The MIT License (MIT)
Copyright (c) 2015
Permission is hereby granted, free of charge, to any person obtaining a copy
@staltz
staltz / introrx.md
Last active July 13, 2025 10:33
The introduction to Reactive Programming you've been missing
@tsolar
tsolar / laravel-subdirectory.conf
Last active July 2, 2025 21:47
Laravel in subdirectory nginx example
server {
client_body_in_file_only clean;
client_body_buffer_size 32K;
client_max_body_size 300M;
sendfile on;
send_timeout 300s;
# Port that the web server will listen on.
#listen 80;
@hnq90
hnq90 / parry-server
Last active August 29, 2015 14:05
Startup script for the Parry Server
#!/bin/bash
#
# parry-server Startup script for the Parry Server
#
# chkconfig: - 85 15
# description: PARRY Server Service
# author: HuyNQ <[email protected]>
# processname: parry-server
#
PARRY_HOME="parry-directory"