Skip to content

Instantly share code, notes, and snippets.

View sobujbd's full-sized avatar

Sobuj sobujbd

  • Bangladesh
View GitHub Profile
mbleigh /
Last active September 22, 2023 17:55
Firebase Hosting Fetch All Files

Fetch All Files from Firebase Hosting

This script fetches all of the files from the currently deployed version of a Firebase Hosting site. You must be signed in via the Firebase CLI and have "Site Viewer" permission on the site in question to be able to properly run the script.

Running via NPX

npx <site_name>
View make-cert.bat
@echo off
set /p domain="Enter Domain: "
set OPENSSL_CONF=../conf/openssl.cnf
if not exist .\%domain% mkdir .\%domain%
..\bin\openssl req -config cert.conf -new -sha256 -newkey rsa:2048 -nodes -keyout %domain%\server.key -x509 -days 3650 -out %domain%\server.crt
echo -----
dionysius /
Last active September 13, 2022 13:16
Setup launcher icon (.desktop file) for AMPPS. Tested for elementaryOS freya, but should work with most ubuntu derivates.

Fix/Create AMPPS Launcher icon (.desktop file)

Install AMPPS with default options (at this time of writing there are no options). Expecting it is installed in /usr/local/ampps/*

Since its important to place the new files at specific locations, you need to adapt the filename as requested. All files are owned by root.

ampps_starter: place this file exactly as /usr/local/bin/ampps and make it executable


ronaldsmartin /
Last active June 15, 2023 20:54
Google Spreadsheet JSON Queries

SheetAsJSON + Filtering

This is an extension of DJ Adams' excellent SheetAsJSON Google Apps Script, which provides a way to GET a published Google Spreadsheet as a JSON feed. This version allows generic filtering for terms, more specific control over which rows to parse, and correct MIME type for JSONP output.

Minimal Usage

The following parameters are required for the script to work.
+ id=<spreadsheet key>
+ sheet=<sheet name on spreadsheet>
trajche / unzip.php
Last active September 28, 2022 18:17
Unzip a file on with PHP
View unzip.php
$unzip = new ZipArchive;
$out = $unzip->open('');
if ($out === TRUE) {
echo 'File unzipped';
} else {
echo 'Something went wrong?';
tschoffelen / install.php
Last active August 8, 2023 07:11
A simple PHP script that automatically downloads and unzips the latest version of Wordpress in the current directory (./), so that I don't have to download it and upload it to my server through FTP manually.
View install.php
echo '<pre>';
echo '<span style="color:blue">DOWNLOADING...</span>'.PHP_EOL;
// Download file
file_put_contents('', file_get_contents(''));
$zip = new ZipArchive();
$res = $zip->open('');
if ($res === TRUE) {
rxaviers / gist:7360908
Last active October 1, 2023 14:13
Complete list of github markdown emoji markup
View gist:7360908


:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
dyaa / check.js
Created September 30, 2013 15:02
Check if jplayer is playing
View check.js
swfPath: "",
ready: function () {
$(this).jPlayer("setMedia", { mp3: ";stream/1" });
supplied: "mp3"
setInterval(function () {
var isPaused = $('#jquery_jplayer_1').data().jPlayer.status.paused;
gerbenvandijk / Mark parent navigation active when on custom post type single page
Last active August 2, 2023 08:15
Mark (highlight) custom post type parent as active item in Wordpress Navigation.When you visit a custom post type's single page, the parent menu item (the post type archive) isn't marked as active. This code solves it by comparing the slug of the current post type with the navigation items, and adds a class accordingly.
View Mark parent navigation active when on custom post type single page
function add_current_nav_class($classes, $item) {
// Getting the current post details
global $post;
// Get post ID, if nothing found set to NULL
$id = ( isset( $post->ID ) ? get_the_ID() : NULL );
JeffreyWay /
Created July 28, 2012 19:09
PHP: Set value if not exist

You know how, in JavaScript, we can set a value to a variable if one doesn't, like this:

name = name || 'joe';

This is quite common and very helpful. Another option is to do:

name || (name = 'joe');