Skip to content

Instantly share code, notes, and snippets.

View quyen91's full-sized avatar
🌴
On vacation

quyencv quyen91

🌴
On vacation
View GitHub Profile
@quyen91
quyen91 / Mutltiple_SSH.md
Created September 29, 2018 02:45 — forked from hkasera/Mutltiple_SSH.md
How to use multiple github accounts?

I have two accounts on github, one is personal account and other is office account. I typically face this problem to manage pushing to different repos using these different accounts.

I found a great way of doing it without any hassle.

Step 1 : Generate different ssh keys for both the accounts

Suppose my personal id is jane@gmail.com and office account is jane@doe.com

Follow the steps mentioned here to generate ssh keys : https://help.github.com/articles/generating-ssh-keys/

@quyen91
quyen91 / main.go
Created July 15, 2018 05:06
GO Demo - GitGo CLI
// "Package main" is the namespace declaration
// "main" is a keyword that tells GO that this project is intended to run as a binary/executable (as opposed to a Library)
package main
// importing standard libraries & third party library
import (
"fmt"
"os"
"strings"
@quyen91
quyen91 / blogspot_to_jekyll.rb
Created June 29, 2018 15:18 — forked from kennym/blogspot_to_jekyll.rb
Migrate your blogger blog posts to jekyll.
#!/usr/bin/env ruby
#
# Convert blogger (blogspot) posts to jekyll posts
#
# Basic Usage
# -----------
#
# ./blogger_to_jekyll.rb feed_url
#
# where `feed_url` can have the following format:
@quyen91
quyen91 / progress_indicators.rb
Created June 3, 2018 06:53 — forked from jpo/progress_indicators.rb
Ruby CLI Progress Indicators
# Terminal Progress Indicators. Four examples are included: percentage,
# spinner, progress bar, and combined. This script has been tested on
# Mac OS X 10.8 with Ruby 1.8.7, 1.9.1, 1.9.2, and 1.9.3
class Spinner
include Enumerable
def each
loop do
yield '|'
yield '/'

To change mappings and reindex elasticsearch data with zero downtime:

  • Create an alias that using to search for model (this point to whatever index we want)
  • Point this alias to old index (avoid app crash when code change)
  • Create new index + import data to this index
  • Point our alias to new index
  • Delete old index
# Add alias user_docs to users index
curl -XPUT 'localhost:9200/users/_alias/user_docs?pretty'
$(function(){
$.getJSON('trello_data.json', function(data) {
$.each(data.lists, function(i, f) {
// display name of all list
tr = $('<tr/>');
tr.attr('id', f.id);
tr.append("<th>" + f.name + "</th>");
$('table').append(tr)
});
@quyen91
quyen91 / arc_setup.sh
Created November 28, 2016 18:13 — forked from makinde/arc_setup.sh
Arc Setup (Ubuntu)
#!/bin/bash
if ! hash git &> /dev/null || ! hash php &> /dev/null; then
echo -e " *****\n ***** INSTALLING GIT AND PHP\n *****"
if hash apt-get &> /dev/null; then
sudo apt-get install git-core php5-cli php5-curl
elif hash port &> /dev/null; then
sudo port install php5-curl
elif hash fink &> /dev/null; then
// view
<a href="" data-id="{{key}}" ng-click="addtocart($event)"> Add</a></td>
// Controller
$scope.addtocart = function(e){
var bookid = $(e.target).data('id');
alert(bookid);
// addtoCart.addtocart(bookid);
}
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width">
<!-- Place favicon.ico and apple-touch-icon.png in the root directory -->
<!-- build:css(.) styles/vendor.css -->
<!-- bower:css -->
'use strict';
/**
* @ngdoc overview
* @name angularShopingCartApp
* @description
* # angularShopingCartApp
*
* Main module of the application.
*/