Skip to content

Instantly share code, notes, and snippets.

View iworkforthem's full-sized avatar

Wai Mun iworkforthem

View GitHub Profile
find . -name 'node_modules' -type d -prune -print -exec rm -rf '{}' \;
#Gist
find . -type f \( -iname "*.sol" \)
#Gist
docker stop $(docker ps -a -q)
docker rm $(docker ps -a -q)
#Gist
find . -name "node_modules" -type d -prune | xargs du -chs
#Gist
@iworkforthem
iworkforthem / gist:199efeb51454c763b307817dea7cc9cf
Created December 1, 2020 07:53
expressjs connect to Materialize
const express = require("express");
const app = express();
const port = 3000;
const { Client } = require("pg");
const client = new Client({
host: "127.0.0.1",
port: 6875,
database: "materialize",
});
brew install imagemagick
brew install ghostscript
magick -density 300 file.pdf file.jpg
ENV REQUESTS_CA_BUNDLE /etc/ssl/certs/ca-certificates.crt
COPY ./ca/Lets_Encrypt_Authority_X3.crt /usr/local/share/ca-certificates
RUN update-ca-certificates
#Gist
"""
.. module:: useful_1
:platform: Unix, Windows
:synopsis: A useful module indeed.
.. moduleauthor:: Andrew Carter <[email protected]>
"""
// call external API
await this.getWeather(turnContext);
// external API via axios
async getWeather(turnContext) {
const axios = require('axios');
try {
const response = await axios.get('https://api.data.gov.sg/v1/environment/psi');
console.log(response.data);
await turnContext.sendActivity('The weather is ' + response.data.api_info.status);
@iworkforthem
iworkforthem / README-Template.md
Created November 13, 2018 09:03 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites