Skip to content

Instantly share code, notes, and snippets.

View sherwinwater's full-sized avatar
🎉

Shuwen sherwinwater

🎉
  • Canada
  • 13:31 (UTC -04:00)
View GitHub Profile
@kettanaito
kettanaito / README.md
Last active June 20, 2024 18:09
Chromium on Vercel (serveless)

Chromium on Vercel (serverless)

This is an up-to-date guide on running Chromium in Vercel serverless functions in 2022. What you will read below is the result of two days of research, debugging, 100+ failed deployments, and a little bit of stress.

Getting started

Step 1: Install dependencies

Use chrome-aws-lambda that comes with Chromium pre-configured to run in serverless, and puppeteer-core due to the smaller size of Chromium distributive.

@SazzadR
SazzadR / button-component-vue-and-tailwind.markdown
Created January 4, 2021 19:01
Button Component Vue and Tailwind
@aedorado
aedorado / docker-compose.yml
Created December 6, 2020 16:24
Docker compose file for ELK 7.9.2
version: '3.7'
services:
elasticsearch:
image: elasticsearch:7.9.2
ports:
- '9200:9200'
environment:
- discovery.type=single-node
ulimits:
@Hitesh822
Hitesh822 / select_list_items.dart
Last active March 19, 2022 16:15
Select List Items In Flutter
import 'package:flutter/material.dart';
void main() => runApp(SelectListItem());
class SelectListItem extends StatefulWidget {
@override
_SelectListItemState createState() => _SelectListItemState();
}
@nyx-code
nyx-code / FileUpload.js
Last active November 25, 2022 20:50
This NodeJS API which will upload files onto the AWS S3 Bucket. Video -> https://youtu.be/TtuCCfren_I
require('dotenv/config')
const express = require('express')
const multer = require('multer')
const AWS = require('aws-sdk')
const uuid = require('uuid/v4')
const app = express()
const port = 3000
@Ciantic
Ciantic / example-typeorm-jest.test.ts
Created April 16, 2019 17:50
Example of testing TypeOrm with Jest and Sqlite in-memory database
import { createConnection, getConnection, Entity, getRepository } from "typeorm";
import { PrimaryGeneratedColumn, Column } from "typeorm";
@Entity()
export class MyEntity {
@PrimaryGeneratedColumn()
id?: number;
@Column()
name?: string;
@niveshsaharan
niveshsaharan / JsColor.js
Last active March 13, 2022 04:01
React.js Component for jscolor.com
import React, { Component } from 'react';
import '../plugins/jscolor/jscolor';
/**
* JsColor
*/
class JsColor extends Component {
/**
* JsColor Constructor
* @param {*} props
@henryscala
henryscala / mariadb_operation_example.c
Created March 16, 2018 02:30
mariadb or mysql prepared statements example using C API
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <mysql/mysql.h>
/*
The program is a demonstration of using prepared statements to perform operations on the below table in mariadb.
The statements include: insert, select, delete, etc.
CREATE TABLE person (
@elikem
elikem / AppMeasurement.js
Created December 16, 2015 17:00
AppMeasurement.js
/* Adobe Analytics
Marketing Reports & Analytics
Copyright 1996-2013 Adobe, Inc. All Rights Reserved */
s = new AppMeasurement();
s.account="outrainjjscit13site05,outrainjjscit13global"
/************************** CONFIG SECTION **************************/
/* You may add or alter any code config here. */
s.charSet="UTF-8"
@TrevorJTClarke
TrevorJTClarke / BrowserDeviceInfo.js
Created September 1, 2015 17:52
A quick list of browsers and devices for use in testing. Chrome is used for all devices that need simulation.
var devices = [
{ name: 'Desktop - Huge', width: 2880, height: 1800, ratio: 2, type: 'desktop' },
{ name: 'Desktop - Extra Large', width: 1920, height: 1080, ratio: 1, type: 'desktop' },
{ name: 'Desktop - Large', width: 1440, height: 900, ratio: 1, type: 'desktop' },
{ name: 'Desktop - HiDPI', width: 1366, height: 768, ratio: 1, type: 'desktop' },
{ name: 'Desktop - MDPI', width: 1280, height: 800, ratio: 1, type: 'desktop' },
{ name: 'Laptop with HiDPI screen', width: 1440, height: 900, ratio: 2, type: 'desktop' },
{ name: 'Laptop with MDPI screen', width: 1280, height: 800, ratio: 1, type: 'desktop' },
{ name: 'Laptop with touch', width: 1280, height: 950, ratio: 1, type: 'desktop' },
{ name: 'Tablet - Portrait', width: 768, height: 1024, ratio: 1, type: 'tablet' },