Skip to content

Instantly share code, notes, and snippets.

View volf52's full-sized avatar
👽
I may be slow to respond.

Muhammad Arslan volf52

👽
I may be slow to respond.
  • Sophia-Antipolis, France
View GitHub Profile
@volf52
volf52 / script-src.html
Created March 9, 2023 13:26
google OpenId
<script src="https://accounts.google.com/gsi/client" async defer></script>
@volf52
volf52 / nginx_assets.md
Created December 11, 2022 18:27 — forked from XUJiahua/nginx_assets.md
Serving Static Assets via Nginx

Concept

  • People talk about two servers: a web server (e.g. Nginx, Apache, etc.) and a app server (e.g. Language specific servers like Unicorn, Node.js, Tomcat, Http-Kit, etc.). There are exceptions where app servers not required at all (as web server itself provides preprocessors for handling), but let's not talk about now.
  • Web servers are really fast and supports lot of standard and commonly used MIME-type requests. Concept of serving a file is -- forming and sending a response of bytes of data and labeling it with requested MIME-type by a client (e.g. web browser).
  • Every response format (in layman's language, a file) is recognized by it's MIME-type, for e.g. a PNG image file has "image/png" MIME-type. JavaScript file has "text/javascript". HTML responses (or files) has "text/html". Plain text files have "text/plain".
  • Modern Browsers supports a lot of standard MIME-types. Images, videos, text files (XML, HTML, SVG, JS), and they better know how to visualize it. Browser also knows unrec
@volf52
volf52 / README.md
Created October 19, 2021 16:07 — forked from chdorner/README.md
SQLAlchemy scan large table in batches

my database had 72k annotations at the time I ran these benchmarks, here's the result:

$ python scripts/batch_bench.py conf/development-app.ini dumb
Memory summary: start
      types |   # objects |   total size
=========== | =========== | ============
       dict |       13852 |     12.46 MB
  frozenset |         349 |     11.85 MB
VM: 327.29Mb

Movies


You've probably seen most of them already. Check the linked clips, and atleast one episode before making the final decision to add/remove it from your list.


@volf52
volf52 / CMakeLists.txt
Created June 15, 2021 12:55 — forked from tdenewiler/CMakeLists.txt
ROS Synchronization Example
cmake_minimum_required(VERSION 2.8.3)
project(sync_example)
find_package(catkin REQUIRED COMPONENTS message_filters roscpp sensor_msgs)
catkin_package(
CATKIN_DEPENDS message_filters roscpp sensor_msgs
)
include_directories(${catkin_INCLUDE_DIRS})
--------------------------------------------------------------------------------
# Crude generation of typo rules
# (Using kwprocessor (https://github.com/hashcat/kwprocessor) and hashcat)
#
# Useful for passwords that don't require confirmation (like some cryptocurrency
# wallets, password-protected archive files, etc.)
#
# May also be useful for stacking with other rules.
#
# This approach assumes that you are making the same typo every time
@volf52
volf52 / auto-run.py
Created October 29, 2020 16:07 — forked from mdwhatcott/auto-run.py
Auto-run `go test` in the console
#!/usr/bin/env python
"""
This script scans the current working directory for changes to .go files and
runs `go test` in each folder where *_test.go files are found. It does this
indefinitely or until a KeyboardInterrupt is raised (<Ctrl+c>). This script
passes the verbosity command line argument (-v) to `go test`.
"""
@volf52
volf52 / quotes.md
Last active October 1, 2024 21:46
Collection of favorite strings of words
  • I hope, Cecily, I shall not offend you if I state quite frankly and openly that you seem to me to be in every way the visible personification of absolute perfection. - Oscar Wilde

  • I couldn't help it; I can resist everything but tempation - Oscar Wilde

@volf52
volf52 / mnist.py
Created April 8, 2020 22:46 — forked from tylerneylon/mnist.py
A function to load numpy arrays from the MNIST data files.
""" A function that can read MNIST's idx file format into numpy arrays.
The MNIST data files can be downloaded from here:
http://yann.lecun.com/exdb/mnist/
This relies on the fact that the MNIST dataset consistently uses
unsigned char types with their data segments.
"""
@volf52
volf52 / second_highest.py
Created November 30, 2019 11:59
Second highest number in array
def second_highest(iterable, key = lambda x: x):
highest = -1
second = -1
for i in iterable:
o = key(i)
if(o > highest):
second, highest = highest, o
elif(o > second):
second = o
return second