Skip to content

Instantly share code, notes, and snippets.

View eminvegan's full-sized avatar

Emin Temiz eminvegan

View GitHub Profile
@eminvegan
eminvegan / generate-pushid.js
Created March 3, 2022 13:54 — forked from mikelehen/generate-pushid.js
JavaScript code for generating Firebase Push IDs
/**
* Fancy ID generator that creates 20-character string identifiers with the following properties:
*
* 1. They're based on timestamp so that they sort *after* any existing ids.
* 2. They contain 72-bits of random data after the timestamp so that IDs won't collide with other clients' IDs.
* 3. They sort *lexicographically* (so the timestamp is converted to characters that will sort properly).
* 4. They're monotonically increasing. Even if you generate more than one in the same timestamp, the
* latter ones will sort after the former ones. We do this by using the previous random bits
* but "incrementing" them by 1 (only in the case of a timestamp collision).
*/
@Munawwar
Munawwar / Dockerfile
Created June 22, 2021 15:31
node.js + puppeteer minimal docker file
# A minimal Docker file for node.js and Puppeteer
# debian 10 (buster slim) amd64 + node v14
# https://hub.docker.com/layers/node/library/node/14.17.1-buster-slim/images/sha256-10c6bf7204614c18b0734a218f576082ea2d15e9af7b7817a07eddcd7d05a255?context=explore
FROM node:14.17.1-buster-slim@sha256:10c6bf7204614c18b0734a218f576082ea2d15e9af7b7817a07eddcd7d05a255
RUN apt-get update \
# Install dependencies of Chromium that Puppeteer installs
# Dependency list for puppeteer v10.0.0 taken from https://github.com/puppeteer/puppeteer/blob/v10.0.0/docs/troubleshooting.md#chrome-headless-doesnt-launch-on-unix
# Puppeteer v10.0.0 installs Chromium 92.0.4512.0 / r884014
@davidteren
davidteren / nerd_fonts.md
Last active August 9, 2025 22:12
Install Nerd Fonts via Homebrew [updated & fixed]
@eminvegan
eminvegan / node_nginx_ssl.md
Created November 18, 2020 19:16 — forked from bradtraversy/node_nginx_ssl.md
Node app deploy with nginx & SSL

Node.js Deployment

Steps to deploy a Node.js app to DigitalOcean using PM2, NGINX as a reverse proxy and an SSL from LetsEncrypt

1. Sign up for Digital Ocean

If you use the referal link below, you get $10 free (1 or 2 months) https://m.do.co/c/5424d440c63a

2. Create a droplet and log in via ssh

I will be using the root user, but would suggest creating a new user

Table "Department" {
"DepartmentID" smallint [not null, increment]
"Name" nvarchar(50) [not null]
"GroupName" nvarchar(50) [not null]
"ModifiedDate" datetime [not null, default: `getdate()`]
Indexes {
DepartmentID [pk]
}
}
#引入函式庫
import requests
import json
# 超連結
url = 'https://www.google.com.tw/maps/preview/review/listentitiesreviews?authuser=0&hl=zh-TW&gl=tw&pb=!1m2!1y3765758546651144975!2y6093113884180453713!2m2!1i0!2i10!3e2!4m5!3b1!4b1!5b1!6b1!7b1!5m2!1sdzvaXrvAMImImAXHsLPICA!7e81'
# 發送get請求
text = requests.get(url).text
# 取代掉特殊字元,這個字元是為了資訊安全而設定的喔。
pretext = ')]}\''
@bradtraversy
bradtraversy / node_nginx_ssl.md
Last active August 13, 2025 14:06
Node app deploy with nginx & SSL

Node.js Deployment

Steps to deploy a Node.js app to DigitalOcean using PM2, NGINX as a reverse proxy and an SSL from LetsEncrypt

1. Sign up for Digital Ocean

If you use the referal link below, you get $10 free (1 or 2 months) https://m.do.co/c/5424d440c63a

2. Create a droplet and log in via ssh

I will be using the root user, but would suggest creating a new user

writeStack = [];
write = function(callback){
if (!writeStack.length) requestAnimationFrame(handleWriteStack);
writeStack.push(callback);
}
handleWriteStack = function(){
while (writeStack.length) writeStack.pop()();
}
@hofmannsven
hofmannsven / README.md
Created December 6, 2017 00:32
Increase key repeat rate on macOS

Increase key repeat rate on macOS

Settings: System Preferences » Keyboard » Key Repeat/Delay Until Repeat

Use the commands below to increase the key repeat rate on macOS beyond the possible settings via the user interface. The changes aren't applied until you restart your computer.

Source: https://apple.stackexchange.com/a/83923

@SheldonWangRJT
SheldonWangRJT / Convert .mov or .MP4 to .gif.md
Last active August 8, 2025 01:13
Convert Movie(.mov) file to Gif(.gif) file in one command line in Mac Terminal

This notes is written by Sheldon. You can find me with #iOSBySheldon in Github, Youtube, Facebook, etc.

Need

Convert .mov/.MP4 to .gif

Reason

As a developer, I feel better to upload a short video when I create the pull request to show other viewers what I did in this PR. I tried .mov format directly got after finishing recording screen using Quicktime, however, gif offers preview in most web pages, and has smaller file size.

This is not limited to developer, anyone has this need can use this method to convert the files.