Skip to content

Instantly share code, notes, and snippets.

View rizky's full-sized avatar
🌪️
Swirling

Rizky Ario rizky

🌪️
Swirling
View GitHub Profile
@joeydumont
joeydumont / resize_images.js
Last active February 28, 2023 18:27
NodeJS code to resize images while keeping the original aspect ratio
// Create clients outside of the handler
// Create a client to read objects from S3
const AWS = require('aws-sdk');
const s3 = new AWS.S3();
// Libraries for image resize.
const stream = require('stream');
@rizky
rizky / docker-gui.sh
Last active May 30, 2021 22:43
Run GUI app from docker
#Install XQuartz and Docker
brew cask install xquartz
brew cask install docker
# Open XQuartz
# In the XQuartz preferences, go to the “Security” tab
# Make sure you’ve got “Allow connections from network clients” ticked
open -a XQuartz
# Setup ENV
@mattiasarro
mattiasarro / tensorflow_1_6_high_sierra_gpu.md
Last active August 24, 2022 15:24 — forked from orpcam/tensorflow_1_6_rc1_high_sierra_gpu.md
Install Tensorflow 1.6 on macOS High Sierra 10.13.3 with GPU Acceleration (without disabling SIP)

Tensorflow 1.6 on macOS High Sierra 10.13.3 with GPU Acceleration (without disabling SIP)

This gist (based on a blog post at byai.io) documents how to set up TensorFlow 1.6 with (e)GPU support without the need to disable SIP. Following the original gist got me a saystem in which training TF on eGPU was successful, but there were various visual glitches due to the newer / less stable version of the driver.

As pointed out by ronchigram, many people are having issues with newer NVIDIA drivers, so it's worth using the nvidia-update script by Benjamin Dobell that installs the latest stable NVIDIA web driver, and if necessary patches it to run on your system. We also don't need to disable SIP when using nvidia-update.

I have als

@jesperorb
jesperorb / cors.md
Last active February 21, 2024 14:17
Handle CORS Client-side

Handle CORS Client-side

Cross-origin resource sharing (CORS) is a mechanism that allows restricted resources (e.g. fonts) on a web page to be requested from another domain outside the domain from which the first resource was served. This is set on the server-side and there is nothing you can do from the client-side to change that setting, that is up to the server/API. There are some ways to get around it tho.

Sources : MDN - HTTP Access Control | Wiki - CORS

CORS is set server-side by supplying each request with additional headers which allow requests to be requested outside of the own domain, for example to your localhost. This is primarily set by the header:

Access-Control-Allow-Origin
@juanca
juanca / github_load_all_diffs.js
Created March 2, 2017 18:42
Github PR bookmarklet: Load all file diffs
javascript:
document.querySelectorAll('.load-diff-button').forEach(node => node.click())
@rponte
rponte / connecting-to-database.sh
Last active March 21, 2017 12:37
Script to install MS SQL Server vNext on Linux Ubuntu 16.04 x64
##
# Connecting to database - https://docs.microsoft.com/en-us/sql/linux/sql-server-linux-connect-and-query-sqlcmd
##
# how to connect?
sqlcmd -S localhost -U SA -P 'vagrant@2017'
# how to select all database names?
SELECT Name from sys.Databases;
GO
Check out the [model zoo documentation](http://caffe.berkeleyvision.org/model_zoo.html) for details.
To acquire a model:
1. download the model gist by `./scripts/download_model_from_gist.sh <gist_id> <dirname>` to load the model metadata, architecture, solver configuration, and so on. (`<dirname>` is optional and defaults to caffe/models).
2. download the model weights by `./scripts/download_model_binary.py <model_dir>` where `<model_dir>` is the gist directory from the first step.
or visit the [model zoo documentation](http://caffe.berkeleyvision.org/model_zoo.html) for complete instructions.
### Berkeley-trained models
@kevin-smets
kevin-smets / 1_kubernetes_on_macOS.md
Last active May 5, 2024 10:12
Local Kubernetes setup on macOS with minikube on VirtualBox and local Docker registry

Requirements

Minikube requires that VT-x/AMD-v virtualization is enabled in BIOS. To check that this is enabled on OSX / macOS run:

sysctl -a | grep machdep.cpu.features | grep VMX

If there's output, you're good!

Prerequisites

Build tensorflow on OSX with NVIDIA CUDA support (GPU acceleration)

These instructions are based on Mistobaan's gist but expanded and updated to work with the latest tensorflow OSX CUDA PR.

Requirements

OS X 10.10 (Yosemite) or newer

@revolunet
revolunet / python-es6-comparison.md
Last active April 22, 2024 19:22
# Python VS JavaScript ES6 syntax comparison

Python VS ES6 syntax comparison

Python syntax here : 2.7 - online REPL

Javascript ES6 via Babel transpilation - online REPL

Imports

import math