Skip to content

Instantly share code, notes, and snippets.

View anhnt's full-sized avatar
🏠
Working from home

Anh anhnt

🏠
Working from home
View GitHub Profile
cài đặt nodejs, ruby installer (add to path)
mở commandline với quyền admin/root
gem install compass
npm install grunt-cli -g
npm install bower -g
cd đến thư mục dự án
@Override
public void doProcess(Context context) {
Session session = SessionManager.session();
rootOrg = Organisation.get(rootOrgId, session);
destFields = LeadManContactsImporterUtils.getDestFields(rootOrg);
lg = C(LeadManApp.class).getSalesGroup(session);
UserDao userDao = C(UserDao.class);
GroupManager groupMan = C(GroupManager.class);
@anhnt
anhnt / README.markdown
Created April 28, 2016 06:45 — forked from marijn/README.markdown
List of countries in YAML, CSV and TXT format

#List of countries

It's time someone compiled a list of countries to use within a web application. This gist attempts to make a first move at that.

List of nationalities

I've also compiled a list of nationalities

@anhnt
anhnt / instafeedjsaccess.md
Created June 14, 2016 07:27 — forked from mojaray2k/instafeedjsaccess.md
Getting Instagram Access Token for http://intafeedjs.com

#Use this URL to get your client authorized for Instafeed.JS plugin for Instagram.

  1. First login into your Instargam account
  2. Then go to https://www.instagram.com/developer/
  3. At the top click on the Button that says "Manage Clients".
  4. If you have not Register a new client.
  5. Fill out everything and where it says redirect url put this url: http://instafeedjs.com
  6. Then on the security tab make sure you uncheck "Disable implicit OAuth"
  7. Finally use this link to authoruize Instafeed. Where it says "[Client ID]" replace that including the brackets with your clientID from instagram:
  8. https://instagram.com/oauth/authorize/?client_id=[Client ID]&redirect_uri=http://instafeedjs.com&response_type=token
@anhnt
anhnt / call-apply-bind-proxy.js
Created July 11, 2016 03:08 — forked from branneman/call-apply-bind-proxy.js
JavaScript call() vs apply() vs bind() vs $.proxy()
var fn = function(arg1, arg2) {
var str = '<p>aap ' + this.noot + ' ' + arg1 + ' ' + arg2 + '</p>';
document.body.innerHTML += str;
};
var context = {
'noot': 'noot'
};
var args = ['mies', 'wim'];
// Calls a function with a given 'this' value and arguments provided individually.
STEP 1
Perform full installation of C++ Build Tools 2015 (from: https://blogs.msdn.microsoft.com/vcblog/2016/03/31/announcing-the-official-release-of-the-visual-c-build-tools-2015/)
(I say full install because this is what I did, however I don't claim that the full install is necessary)
Note: this may take a while as the full program is over 4GB
STEP 2
Install Python 2.7.11 (from: https://www.python.org/)
Note: during installation select the "add to PATH" option (which is not selected by default)
STEP 3
// Restify Server CheatSheet.
// More about the API: http://mcavage.me/node-restify/#server-api
// Install restify with npm install restify
// 1.1. Creating a Server.
// http://mcavage.me/node-restify/#Creating-a-Server
var restify = require('restify');
<script>
/**
* Show error message
* @param {jQuery} form
* @param {Object} config
* @param {String|Array} message
*/
function showErrorMessage(form, config, message) {
config = getFormConfig(form, config);
@anhnt
anhnt / reset-wsl.sh
Created January 12, 2018 09:40 — forked from ishu3101/reset-wsl.sh
Resetting your Windows Subsystem for Linux (WSL) Environment
# Resetting your Windows Subsystem for Linux (WSL) Environment
lxrun.exe /uninstall /full
lxrun.exe /install
@anhnt
anhnt / DKIM_SPF_Sendmail
Created January 25, 2018 17:14 — forked from artmouse/DKIM_SPF_Sendmail
DKIM + SPF + Sendmail for multiple domains (Ubuntu)
DKIM is DomainKeys Identified Mail and is used in mail servers, such as Postfix or Sendmail to sign e-mails and thus authenticating the sender so that a forgery can be detected. It also reduces the possibility of an e-mail being flagged as spam, but it's not a definite prevention.
A much simpler method is using SPF (Sender Policy Framework) which, in a nutshell, verifies the sender IP address.
According to the internet, using both should result to ????, PROFIT !!!.
SPF does not need a specific configuration. Whitelisted servers are listed in a DNS record, TXT or SPF, and an example record is:
example.com. IN TXT "v=spf1 a mx ~all"