Skip to content

Instantly share code, notes, and snippets.


Anis uddin Ahmad ajaxray

View GitHub Profile
ajaxray / backpack_customizations.css
Last active Aug 13, 2022
Make active/inactive status of simple filters clear and vivid (
View backpack_customizations.css
#bp-filters-navbar .nav-item[filter-type="simple"]:not(.active) a:before {
content: '️️️⬜️ '
#bp-filters-navbar .nav-item[filter-type="simple"].active a:before {
content: '️️️✅️ '
ajaxray / gtask.go
Created Oct 17, 2021
Listing Projects and tasks from Google Tasks
View gtask.go
package main
import (
ajaxray /
Last active Jun 13, 2022
Shell script to update a yaml configuration using sed
echo "Replacing FB Access Token"
echo "--------------------\n"
# Displaying old value for reference
echo "### Old configuration"
grep ' access_token:' config.yml
echo "### New configuration"
echo " access_token: \"$1\""
sed -i "" "s/^\s+access_token: .*$/ access_token: \"${1}\"/" config.yml
ajaxray /
Last active Aug 17, 2020
Testing a REST API with curl

Testing REST API using curl

This gist lists only the basic commands to test REST APIs with curl. If you need something more advanced, this book has everything you may need.

Simple GET Requests

Display the response only

ajaxray / wait_for_signal.go
Last active Jan 27, 2019
Simple go function to prevent exiting program until SIGINT (Ctrl+C) or SIGTERM is received.
View wait_for_signal.go
package main
import (
func main() {
ajaxray / sql_to_csv.go
Last active Dec 20, 2018
Parse a MySQL dump and prints table/field definitions as CSV (including Table/field comments)
View sql_to_csv.go
package main
import (
ajaxray / ListProvider.php
Created Aug 26, 2018
PHP Trait for key key-value array of various entities (e,g, Doctrine 2 ORM)
View ListProvider.php
* Provide key-value list of various entities
* Created by: Anis Ahmad <>
* Created at: 8/26/18 4:42 PM
namespace AppBundle\Traits;
trait ListProvider
ajaxray / result_sequance_no.sql
Last active May 15, 2018
Adding row sequence number to MySQl result
View result_sequance_no.sql
@a:=@a+1 AS sl,
-- more fields...
(SELECT @a:= 0) AS a,
primary_table_name t
JOIN other_table ot ON t.other_id =
ajaxray / go-http-nginx.conf
Created Feb 16, 2018
Serve go / Golang HTTP/HTTPS app with Nginx as a subdomain
View go-http-nginx.conf
upstream go-http-backend {
keepalive 20;
server {
listen 80;
# adjust as per app's requirement
ajaxray / my-app.tld.conf
Created Oct 29, 2017
Use NGINX as proxy server for Node ExpressJS application.
View my-app.tld.conf
server {
listen 80 default_server;
listen [::]:80 default_server;
server_name my-app.tld;
# Serve assets directly from nginx
location ~ ^/(scripts/|images/|img/|js/|css/|stylesheets/|media/|robots.txt|humans.txt|favicon.ico) {
root /path/to/my-app/public/;
access_log off;