Skip to content

Instantly share code, notes, and snippets.

@febritecno
febritecno / main.js
Last active August 31, 2023 03:25
BOT TELEGRAM CEK RESI NINJA EXPRESS https://glitch.com
const express = require("express");
const cs = require("cloudscraper");
const q = require("request");
const qjob = require("qjobs");
const Telegraf = require("telegraf");
const Logs = require("telegraf-update-logger");
const Extra = require("telegraf/extra");
const Markup = require("telegraf/markup");
const Composer = require("telegraf/composer");
const session = require("telegraf/session");
@ellefsen
ellefsen / Procfile
Last active October 28, 2020 02:47
Heroku with Google Cloud SQL and cloud_sql_proxy with PHP / Laravel
web: (bash ./start.sh) & vendor/bin/heroku-php-nginx public/
@crittermike
crittermike / wget.sh
Last active March 26, 2024 22:49
Download an entire website with wget, along with assets.
# One liner
wget --recursive --page-requisites --adjust-extension --span-hosts --convert-links --restrict-file-names=windows --domains yoursite.com --no-parent yoursite.com
# Explained
wget \
--recursive \ # Download the whole site.
--page-requisites \ # Get all assets/elements (CSS/JS/images).
--adjust-extension \ # Save files with .html on the end.
--span-hosts \ # Include necessary assets from offsite as well.
--convert-links \ # Update links to still work in the static version.
@harrypujols
harrypujols / execute.js
Created May 9, 2017 19:48
Execute shell command in javascript
#!/usr/bin/env node
function execute(command) {
const exec = require('child_process').exec
exec(command, (err, stdout, stderr) => {
process.stdout.write(stdout)
})
}
@aamnah
aamnah / server.js
Created March 5, 2017 15:01
Basic API using Nodejs + Express + MongoDB (less than 100 lines of code, adds + finds vehicles)
/*
path: server.js
*/
// Require shit
const express = require('express');
const bodyParser = require('body-parser');
const mongoose = require('mongoose');
// Let's import our Vehicle model
@weihanglo
weihanglo / draw_gradient_pillow.py
Last active June 15, 2023 04:10
Draw gradient color with Pillow
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from PIL import Image, ImageDraw
im = Image.open('img_original.png')
def interpolate(f_co, t_co, interval):
det_co =[(t - f) / interval for f , t in zip(f_co, t_co)]
for i in range(interval):
@banghasan
banghasan / SendTestBot.php
Last active March 20, 2023 00:30
Test Send Message Pakai PHP - Curl
<?php
/*
Simple File untuk Ngetes Send Pesan ke Bot
Memiliki banyak kegunaan dan tujuan
misalnya ngetes pesan dengan format tertentu, line break, char khusus, dll.
bisa dipergunakan juga untuk test hosting, cronjob, dan segala test lainnya.
Jika menggunakan mode GET :
@banghasan
banghasan / PertamaBot.php
Last active December 23, 2022 14:52
Sample Bot Telegram - PHP
<?php
/*
BOT PENGANTAR
Materi EBOOK: Membuat Sendiri Bot Telegram dengan PHP
Ebook live http://telegram.banghasan.com/
oleh: bang Hasan HS
@bueckl
bueckl / wget
Last active October 11, 2023 08:05
Wget examples
#Spider Websites with Wget – 20 Practical Examples
Wget is extremely powerful, but like with most other command line programs, the plethora of options it supports can be intimidating to new users. Thus what we have here are a collection of wget commands that you can use to accomplish common tasks from downloading single files to mirroring entire websites. It will help if you can read through the wget manual but for the busy souls, these commands are ready to execute.
1. Download a single file from the Internet
wget http://example.com/file.iso
2. Download a file but save it locally under a different name
wget ‐‐output-document=filename.html example.com
@irazasyed
irazasyed / manage-etc-hosts.sh
Created March 7, 2015 09:16
Bash Script to Manage /etc/hosts file for adding/removing hostnames.
#!/bin/sh
# PATH TO YOUR HOSTS FILE
ETC_HOSTS=/etc/hosts
# DEFAULT IP FOR HOSTNAME
IP="127.0.0.1"
# Hostname to add/remove.
HOSTNAME=$1