Skip to content

Instantly share code, notes, and snippets.

View ilmsg's full-sized avatar
😍
love me love my bug

Eak Netpanya ilmsg

😍
love me love my bug
View GitHub Profile
@ComFreek
ComFreek / mocha, chai: TypeScript unit tests, synchronous & asynchronous.md
Last active October 12, 2018 03:29
mocha, chai: TypeScript unit tests, synchronous & asynchronous

TypeScript unit tests

  1. npm install mocha chai ts-node typescript @types/mocha @types/chai --save-dev

  2. Edit your package.json to include:

     scripts: {
      "test": "node --harmony node_modules/mocha/bin/mocha --harmony -r ts-node/register *.spec.ts"
    }
    
@panacholn
panacholn / nodemailer_example.js
Last active June 22, 2023 10:12
Nodemailer Example
// main.js
const nodemailer = require('nodemailer');
// setup mail transporter service
const transporter = nodemailer.createTransport({
service: 'hotmail',
auth: {
user: '[email protected]', // your email
pass: 'password' // your password
}
@troyharvey
troyharvey / .gitlab-ci.yml
Last active March 6, 2026 08:33
Deploy Google Cloud Functions: GitLab CI/CD Pipeline Config File
# Update Jan 2024
# Deploying Cloud Functions is much simpler than it was 6 years ago.
# I'm leaving the gist in it's original 2018 state for now,
# but skip the the recent comments below for a simpler solution.
variables:
GCP_ZONE: us-central1-a
stages:
- npm-install
##
## How to install mcrypt in php7.2 / php7.3
## Linux / MacOS / OSX
##
## https://lukasmestan.com/install-mcrypt-extension-in-php7-2/
#
@boostup
boostup / server.js
Last active July 24, 2020 10:43 — forked from RichFromGalvanize/gist:5873044
node.js: an image piping example using express and request
var request = require('request');
var express = require('express');
var app = express();
app.get('/goofy', function(req, res) {
request('http://images1.wikia.nocookie.net/__cb20120715102950/disney/images/a/a5/Disneygoofy2012.jpeg').pipe(res);
});
app.get('/loop', function(req, res) {
res.render('mypage');
@bnoordhuis
bnoordhuis / bytestokey.js
Created November 29, 2017 22:55
Compute key+IV from passphrase (createCipher to createCipheriv migration script)
// Copyright (c) 2017, Ben Noordhuis <[email protected]>
//
// Permission to use, copy, modify, and/or distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
// copyright notice and this permission notice appear in all copies.
//
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
@t4sk
t4sk / a-usage.md
Last active August 9, 2025 16:01
gen_tcp and GenServer example in Elixir (1.5.2)

gen_tcp and GenServer example in Elixir (1.5.2)

Usage

server.ex

Server.start
@rajshah001
rajshah001 / gist:c53bb363c8fd5874be4055f58b274367
Created November 16, 2017 15:17
It is a Tic Tac Toe Game created by me. It is a basic game but,I hope that you would like it.
import time
import random
# asks for the sign from user
print("Which sign do you want to have ? x or o")
ask_sign = input()
# introduction
print("""|------|------|------|
| 1 | 2 | 3 |
|------|------|------|
@shopglobal
shopglobal / gist:75870369efd042031f67e98976892850
Created November 3, 2017 21:20
How To Set Up Automatic Deployment with Git with a VPS
Introduction
For an introduction to Git and how to install, please refer to the introduction tutorial.
This article will teach you how to use Git when you want to deploy your application. While there are many ways to use Git to deploy our application, this tutorial will focus on the one that is most straightforward. I assume you already know how to create and use a repository on your local machine. If not, please refer to this tutorial.
When you use Git, the workflow generally is toward version control only. You have a local repository where you work and a remote repository where you keep everything in sync and can work with a team and different machines. But you can also use Git to move your application to production.
Server Setup
Our fictitious workspace:
@asukakenji
asukakenji / go-stdlib-interface-selected.md
Last active April 3, 2026 08:51
Go (Golang) Standard Library Interfaces (Selected)

Go (Golang) Standard Library Interfaces (Selected)

This is not an exhaustive list of all interfaces in Go's standard library. I only list those I think are important. Interfaces defined in frequently used packages (like io, fmt) are included. Interfaces that have significant importance are also included.

All of the following information is based on go version go1.8.3 darwin/amd64.