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
// 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');
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
@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.
@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&amp;response_type=token
@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

@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);
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
@anhnt
anhnt / gist:e5ab383ce039855a96fe
Created March 20, 2015 10:10
fomula home credit
var a = $(".result span:first");
var c = b[0]; // object calculator
c.calc.data = [{
"1000000": 208000,
"2000000": 416000,
"3000000": 625000,
"4000000": 833000,
Câu 1. Bạn hãy cho biết đoạn code sau sẽ in ra gì ở Javascript console
(function($){
$(function(){
var a = 1;
b = 2;
window.c = 3;
});
})(jQuery);
console.log(a);
a = 4;
@anhnt
anhnt / google-map-places-demo.html
Last active August 29, 2015 14:04
google place autocomplete
<!DOCTYPE html>
<html>
<head>
<script src="https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false&libraries=places"></script>
<script>
window.onload = function(){
var locationField = document.getElementById('locationField');
var input = document.createElement('input');
input.setAttribute('id','autocomplete');
input.setAttribute('type','text');