Skip to content

Instantly share code, notes, and snippets.

View trandaison's full-sized avatar

Son Tran trandaison

View GitHub Profile
@trandaison
trandaison / after.sh
Created August 30, 2016 16:15 — forked from cluppi/after.sh
Turning SSL on for Homestead
#!/bin/sh
# Config for SSL.
echo "--- Making SSL Directory ---"
mkdir /etc/nginx/ssl
echo "--- Copying $i SSL crt and key ---"
openssl req -nodes -new -x509 -keyout /etc/nginx/ssl/server.key -out /etc/nginx/ssl/server.crt -subj "/C=US/ST=NY/L=NYC/O=Dis/CN=www.example.com"
echo "--- Turning SSL on in nginx.conf. ---"
Atom_backup
package chuong_6;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.HashMap;
import java.util.Iterator;
public class Bai6_3 {
public static void main(String[] args) throws IOException {
<button type="button" name="submit" class="btn-save btn-primary btn">Save</button>
<script>
$(document).ready(function() {
$('.btn-save').on('click', function() {
$.ajax({
type: 'POST',
url: '/workspaces/<%= params[:id] %>',
data: {
_method: "patch",
@trandaison
trandaison / page_load.md
Last active December 22, 2016 09:54
Display Loading Image While Page Loads

#Add the Page Loader Div Add the below div right below the opening tag.

<div class="loader"></div>

#Add some CSS

.loader {
  position: fixed;
 left: 0px;
@trandaison
trandaison / Install Kingsoft Office 2013.md
Last active December 23, 2016 06:22
Install Kingsoft Office 2013 for Linux on Ubuntu 14.04

#Step 1: Remove previous Kingsoft Office package

sudo apt-get purge kingsoft-office

#Step 2: Install Kingsoft Office (64-bit)

sudo dpkg --add-architecture i386
sudo apt-get update
wget kingsoft kdl.cc.ksosoft.com/wps-community/kingsoft-office_9.1.0.4280~a12p4_i386.deb
sudo dpkg -i kingsoft-office_9.1.0.4280~a12p4_i386.deb
@trandaison
trandaison / nodejs_on_ubuntu.md
Last active March 29, 2017 00:37
Install Nodejs on Ubuntu
sudo apt-get install npm
sudo npm cache clean -f
sudo npm install -g n
sudo n stable
sudo ln -sf /usr/local/n/versions/node/<VERSION>/bin/node /usr/bin/node 

To upgrade to latest version (and not current stable) version, you can use

<html>
<head>
<title>Google Maps Multiple Markers</title>
<script src="http://maps.google.com/maps/api/js?sensor=false" type="text/javascript"></script>
</head>
<body>
<div id="map" style="height: 400px; width: 500px;">
</div>
<script type="text/javascript">
@trandaison
trandaison / atom_snippets.cson
Last active May 24, 2017 07:43
Atom configs
'.source.ruby':
'Redirect to':
'prefix': 'redi'
'body': "redirect_to ${1:some}_path"
'flash[:key] = value':
'prefix': 'flash'
'body': 'flash[${1::success}] = ${2:"Created successfully."}$3'
'render json':
'prefix': 'renjson'
@trandaison
trandaison / install_ruby.md
Created June 12, 2017 09:49
Install Ruby using RVM
  1. install RVM
\curl -sSL https://get.rvm.io | bash -s stable
  1. List all ruby versions
rvm list known
  1. Install a version of Ruby