Skip to content

Instantly share code, notes, and snippets.

View xgenvn's full-sized avatar

TuNA xgenvn

View GitHub Profile
@elandau
elandau / StateMachine
Created October 30, 2014 23:22
Rx based state machine
package com.netflix.experiments.rx;
import java.util.HashMap;
import java.util.Map;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import rx.Observable;
import rx.Observable.OnSubscribe;
@davidfowl
davidfowl / dotnetlayout.md
Last active April 20, 2025 06:58
.NET project structure
$/
  artifacts/
  build/
  docs/
  lib/
  packages/
  samples/
  src/
 tests/
@learncodeacademy
learncodeacademy / deployUser.md
Last active October 8, 2022 18:56
Adding a deploy user in Linux

(wherever it says url.com, use your server's domain or IP)

Login to new server as root, then add a deploy user

sudo useradd --create-home -s /bin/bash deploy
sudo adduser deploy sudo
sudo passwd deploy

And Update the new password

@LeCoupa
LeCoupa / bash-cheatsheet.sh
Last active April 19, 2025 04:38
Bash CheatSheet for UNIX Systems --> UPDATED VERSION --> https://github.com/LeCoupa/awesome-cheatsheets
#!/bin/bash
#####################################################
# Name: Bash CheatSheet for Mac OSX
#
# A little overlook of the Bash basics
#
# Usage:
#
# Author: J. Le Coupanec
# Date: 2014/11/04
@shymonk
shymonk / customize-save-in-django-admin-inline-form.org
Last active November 14, 2024 11:30
How to customize save in django admin inline form?

Customize Save In Django Admin Inline Form

Background

This is a common case in django ORM.

from django.db import models

class Author(models.Model):
@CodinCat
CodinCat / Phalcon+WebFaction.md
Last active June 17, 2019 12:51
Install Phalcon on WebFaction host

How to install Phalcon on WebFaction

http://www.webfaction.com/

WebFaction is a great hosting service for everyone, it's as easy as shared hosting, and as powerful as VPS. SSH is allowed, and built in git, so you can install anything you want.

WebFaction uses CentOS 64bit, here is the installation guide with PHP 5.5

@staltz
staltz / introrx.md
Last active April 19, 2025 05:15
The introduction to Reactive Programming you've been missing
@TravelingTechGuy
TravelingTechGuy / Object2QS.js
Last active September 28, 2022 07:19
JSON object to query string (using underscore/lodash)
var objectToQueryString = function(obj) {
var qs = _.reduce(obj, function(result, value, key) {
return (!_.isNull(value) && !_.isUndefined(value)) ? (result += key + '=' + value + '&') : result;
}, '').slice(0, -1);
return qs;
};
@Kartones
Kartones / postgres-cheatsheet.md
Last active April 18, 2025 10:32
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

Some interesting flags (to see all, use -h or --help depending on your psql version):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)