Skip to content

Instantly share code, notes, and snippets.

View ngunhaSO's full-sized avatar
💭
Learn new thing everyday.

Nhan Nguyen ngunhaSO

💭
Learn new thing everyday.
View GitHub Profile
@ngunhaSO
ngunhaSO / mir
Created December 17, 2018 02:24
mir
Basic YWRtaW46OGM2OTc2ZTViNTQxMDQxNWJkZTkwOGJkNGRlZTE1ZGZiMTY3YTljODczZmM0YmI4YTgxZjZmMmFiNDQ4YTkxOA==
@ngunhaSO
ngunhaSO / js gist
Last active November 27, 2018 08:10
js gist
npm-debug.log
.DS_Store
*.js.map
app/**/*.js
hooks/
lib/
node_modules/
platforms/
tmp/
@ngunhaSO
ngunhaSO / virtualbox
Created November 19, 2018 07:46
virtualbox
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDMgExo6pjh3oVjfdwIkCwvEl66Z15fqqPUp390KHM2d0x78qlEIOFCVMg/1SNOHEfPX24C3Lspip4axSOMXRqP1NvftuZYxrRCVO4OCI2AAcyTfwWWOVk3aEqfv2Nl44dQ7oxWn/ilM2WCZcvymDiFgfm0eS+TJv8NIxXUXZRYAQh3b3aP0BrE/vtFy9ECXi6/HIUVwsTS/pRVv9W9GPsEUwW6t7Sb9vZnRQwxWfio/ybyl1b4wvKFXUNgXu5qJM2ot/fokyMhkh8oXD/twAoDxsMkWj6Dp2SO8+2QevyL61eoQrdt+uQ7/NtP8FnEooH86S+SS/A/aXYxMKyia421 mirex@mir_simulator
@ngunhaSO
ngunhaSO / accessing-virtualbox.md
Created October 5, 2018 09:58
Accessing your Virtualbox Guest from your Host OS

Accessing your Virtualbox Guest from your Host OS

As a developer you want to ping and access the webserver on your virtual machine. This is a very simple solution to enable the bridge to the guest VM.

Requirements

  • VirtualBox (latest version)
  • A guest operation system (e.g. Ubuntu)
@ngunhaSO
ngunhaSO / raspbian-python3.6.rst
Created September 13, 2018 00:50 — forked from dschep/raspbian-python3.6.rst
Installing Python 3.6 on Raspbian

Installing Python 3.6 on Raspbian

As of January 2018, Raspbian does not yet include the latest Python release, Python 3.6. This means we will have to build it ourselves, and here is how to do it. There is also an ansible role attached that automates it all for you.

  1. Install the required build-tools (some might already be installed on your system).

import vtk
def checkQualityAndTriangulate():
reader = vtk.vtkSTLReader()
reader.SetFileName('data/3D_data/demoparts/test.stl')
reader.Update()
srcPolyData = reader.GetOutput()
triangleFilter = vtk.vtkTriangleFilter()
triangleFilter.SetInputConnection(reader.GetOutputPort())
@ngunhaSO
ngunhaSO / convert_obj_to_stl.py
Last active March 2, 2024 23:07
Convert obj file to stl
import vtk
reader = vtk.vtkOBJReader()
reader.SetFileName('data/3D_data/demoparts/1_with_wall.obj')
reader.Update()
triangle = vtk.vtkTriangleFilter()
triangle.SetInputConnection(reader.GetOutputPort())
surface = triangle.GetOutputPort()
# retrieve the original stl file
stl_reader = vtk.vtkSTLReader()
stl_reader.SetFileName('path_to_stl')
stl_reader.Update()
stl_poly_data = stl_reader.GetOutput()
# triangulate the stl
triangleFilter = vtk.vtkTriangleFilter()
triangleFilter.SetInputConnection(stl_reader.GetOutputPort())
triangleFilter.Update()
(function () {
'use strict';
angular.module('app')
.config(['$stateProvider', '$urlRouterProvider',
function ($stateProvider, $urlRouterProvider) {
$stateProvider
.state('question', {
url: '/',
templateUrl: 'app/question/questionTemplate.html',
controller: 'questionController as vm'
<section class="agenda" style="margin-top: -30px">
<div class="expanded title">
<h3 class="text-center">{{agenda}}</h3>
</div>
<br>
<p class="text-center" ng-model="Summit"><span ng-bind="Summit"</span></p>
<div class="row details">
<div class="column medium-20 medium-push-2" ng-repeat="agenda in agendaModel" ng-class="{'isHeader': (agenda.agendaClass == 'header'), isSub: (agenda.agendaClass == 'sub')}">
<div>
<div class="column small-2 medium-4 time text-center">