Skip to content

Instantly share code, notes, and snippets.

View ajaxray's full-sized avatar
🪁
Exploring

Anis uddin Ahmad ajaxray

🪁
Exploring
View GitHub Profile
@ajaxray
ajaxray / 1_Typora_Callout.md
Last active April 30, 2025 15:31
Making Notion style callout in Typora using custom CSS

Making Notion style callout in Typora using custom CSS

Do you want this type of callouts in typora? CleanShot 2022-12-03 at 19 02 01@2x

It's simple.

  • Copy the contents of callout.css at the bottom of your user base.user.css file.
    • You'll the find the base.user.css in typora theme folder. (Preference > Appearance > "Open theme folder")
  • If no base.user.css file is found in that folder, create one.
@ajaxray
ajaxray / backpack_customizations.css
Last active August 13, 2022 17:15
Make active/inactive status of simple filters clear and vivid (backpackforlaravel.com)
#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
ajaxray / gtask.go
Created October 17, 2021 18:11
Listing Projects and tasks from Google Tasks
package main
import (
"encoding/json"
"fmt"
"io/ioutil"
"log"
"net/http"
"os"
@ajaxray
ajaxray / update_token.sh
Last active June 13, 2022 13:29
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
ajaxray / REST_with_curl.md
Last active June 24, 2025 16:39
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
ajaxray / wait_for_signal.go
Last active January 27, 2019 17:55
Simple go function to prevent exiting program until SIGINT (Ctrl+C) or SIGTERM is received.
package main
import (
"fmt"
"os"
"os/signal"
"syscall"
)
func main() {
@ajaxray
ajaxray / sql_to_csv.go
Last active December 20, 2018 07:09
Parse a MySQL dump and prints table/field definitions as CSV (including Table/field comments)
package main
import (
"flag"
"fmt"
"io/ioutil"
"os"
"regexp"
"strings"
)
@ajaxray
ajaxray / ListProvider.php
Created August 26, 2018 14:18
PHP Trait for key key-value array of various entities (e,g, Doctrine 2 ORM)
<?php
/**
* Provide key-value list of various entities
*
* Created by: Anis Ahmad <[email protected]>
* Created at: 8/26/18 4:42 PM
*/
namespace AppBundle\Traits;
trait ListProvider
@ajaxray
ajaxray / result_sequance_no.sql
Last active May 15, 2018 07:59
Adding row sequence number to MySQl result
SELECT
@a:=@a+1 AS sl,
t.field_name,
ot.other_field_name,
-- more fields...
FROM
(SELECT @a:= 0) AS a,
primary_table_name t
JOIN other_table ot ON t.other_id = ot.id
WHERE
@ajaxray
ajaxray / go-http-nginx.conf
Created February 16, 2018 14:33
Serve go / Golang HTTP/HTTPS app with Nginx as a subdomain
upstream go-http-backend {
server 127.0.0.1:3000;
keepalive 20;
}
server {
listen 80;
server_name sub.domain.com;
# adjust as per app's requirement