Skip to content

Instantly share code, notes, and snippets.

@Syed-Hassaan
Syed-Hassaan / Set Up and Configure a Cloud Environment in Google Cloud Challenge Lab.txt
Last active August 16, 2024 10:22
Set Up and Configure a Cloud Environment in Google Cloud: Challenge Lab # GSP321
######################################################################################
## Set Up and Configure a Cloud Environment in Google Cloud: Challenge Lab # GSP321 ##
######################################################################################
====================== TASK 1: Create development VPC manually ======================
gcloud compute networks create griffin-dev-vpc --subnet-mode custom
gcloud compute networks subnets create griffin-dev-wp --network=griffin-dev-vpc --region us-east1 --range=192.168.16.0/20
@lennardv2
lennardv2 / 1. Building PHP-MAMP on Apple Silicon M1.md
Last active October 3, 2024 20:29
Native PHP development / MAMP stack on Apple silicon M1

Building the MAMP stack (php, apache & mysql) on Apple Silicon ARM (native)

Update! This tutorial is outdated. Nowadays brew installes m1 binaries just fine. Also use valet: https://laravel.com/docs/9.x/valet. It's 10x easier.

In this tutorial, we'll build the the nescessary packages for ARM via homebrew. After that we'll configure apache2 for using virtual hosts. The native php is ofcourse way faster, see the results of this benchmark below.

TEST NAME SECONDS OP/SEC
@ejlp12
ejlp12 / sam_lambda.md
Last active January 14, 2021 07:31
Memulai membuat aplikasi serverless dengan AWS Serverless Application Model (AWS SAM)

Tautan ke halaman ini: https://bit.ly/2UJlHIc

SAM the Squirrel

Jika anda belum mengetahui apa itu komputasi serverless dan AWS Lambda, silakan baca di tautan ini: https://bit.ly/2RkuhLv

SAM

AWS Serverless Application Model (AWS SAM) adalah sebuah open-source framework untuk membangun aplikasi nirserver (serverless) di AWS. Proyek open source AWS SAM dibuat dan didukung oleh AWS, tetapi anda atau komunitas dapat berkontribusi untuk ikut mengembangkannya.

@Ananto30
Ananto30 / sse.go
Last active September 5, 2024 23:04
SSE message stream in Go
// Example SSE server in Golang.
// $ go run sse.go
// Inspired from https://gist.github.com/ismasan/3fb75381cd2deb6bfa9c
package main
import (
"encoding/json"
"fmt"
"log"
// This injects a box into the page that moves with the mouse;
// Useful for debugging
async function installMouseHelper(page) {
await page.evaluateOnNewDocument(() => {
// Install mouse helper only for top-level frame.
if (window !== window.parent)
return;
window.addEventListener('DOMContentLoaded', () => {
const box = document.createElement('puppeteer-mouse-pointer');
const styleElement = document.createElement('style');
@kamoo1
kamoo1 / gpwebapi.py
Last active June 4, 2022 10:22
get complete review from google play store (>4400 limit)
import json
from enum import Enum
from utils.logging import get_logger
logger = get_logger(__name__)
class Pattern(Enum):
# OPTIONAL = 0
@popstas
popstas / docker-logs-localtime
Last active November 14, 2024 06:03
docker-logs-localtime - Replace all UTC dates in docker logs output to local dates in pipe
#!/usr/bin/env node
// replace all UTC dates to local dates in pipe
// usage: docker logs -t container_name | docker-logs-localtime
// install:
// curl https://gist.githubusercontent.com/popstas/ffcf282492fd78389d1df2ab7f31052a/raw/505cdf97c6a1edbb10c3b2b64e1836e0627b87a0/docker-logs-localtime > /usr/local/bin/docker-logs-localtime && chmod +x /usr/local/bin/docker-logs-localtime
// alternative: https://github.com/HuangYingNing/docker-logs-localtime
const pad = d => (d > 9 ? d : '0' + d);
@arjunv
arjunv / keyevents.json
Created December 2, 2018 00:01
All Android Key Events for usage with adb shell
{
"key_events": {
"key_unknown": "adb shell input keyevent 0",
"key_soft_left": "adb shell input keyevent 1",
"key_soft_right": "adb shell input keyevent 2",
"key_home": "adb shell input keyevent 3",
"key_back": "adb shell input keyevent 4",
"key_call": "adb shell input keyevent 5",
"key_endcall": "adb shell input keyevent 6",
"key_0": "adb shell input keyevent 7",
@nhernandezga-old
nhernandezga-old / java-update-alternatives.md
Created September 14, 2018 03:26 — forked from bench/java-update-alternatives.md
java and javac update-alternatives

update-alternatives maintains symbolic links determining default commands This is a reminder to install java and javac alternatives.

Install alternatives

Install java compiler alternatives

$ sudo update-alternatives --install /usr/bin/javac javac /home/bchenebault/Apps/jdk1.5.0_22/bin/javac 1
$ sudo update-alternatives --install /usr/bin/javac javac /home/bchenebault/Apps/jdk1.6.0_45/bin/javac 2
@mraaroncruz
mraaroncruz / steps.md
Last active October 28, 2024 22:04
Get the Telegram channel ID

To get the channel id

  1. Create your bot with botfather
  2. Make you bot an admin of your channel

Simplest way (via @anhtuank7c)

Go to Telegram web and open a channel, get the ID from -[channel id] from hash in the path

https://web.telegram.org/k/#-9999999999999