Skip to content

Instantly share code, notes, and snippets.

View meain's full-sized avatar

Abin Simon meain

View GitHub Profile
@meain
meain / sharescreen
Created January 7, 2022 07:14 — forked from adrianlzt/sharescreen
Scripts to share only a portion of the screen
#!/bin/bash
# Modified version of https://github.com/Ashark/hliss/blob/master/vlc-hangouts
# Script to share a portion of the screen in VLC to be used by Chrome/Firefox to share the screen
# By default, when run, it asks to click in some window. The area of that window is what is going to be shared.
# If executed with "sharescreen area", it asks for a portion of the screen to be shared.
unset x y w h
# Old code to choose a monitor
@meain
meain / default.nix
Created October 20, 2021 15:23 — forked from hgzimmerman/default.nix
Run `nix-shell default.nix` to enable compilation to wasm.
# This works for me with cargo-web (Yew)
with import <nixpkgs> {
overlays = map (uri: import (fetchTarball uri)) [
https://github.com/mozilla/nixpkgs-mozilla/archive/master.tar.gz
];
};
stdenv.mkDerivation {
name = "rust-wasm";
buildInputs = [
@meain
meain / bunny.js
Created April 14, 2020 15:52 — forked from luruke/bunny.js
draw bunny on terminal
const drawille = require('drawille')
const bunny = require('bunny')
const glmatrix = require('gl-matrix')
const width = 200
const height = 200
const canvas = new drawille(width, height)
const mat4 = glmatrix.mat4
const vec3 = glmatrix.vec3
let points = []
@meain
meain / server-cors.py
Created April 6, 2020 11:36 — forked from mkows/server-cors.py
Allow CORS with python Simple HTTP Server – for Python 3
'''
Based on https://gist.github.com/enjalot/2904124 (in Python 2) -> quick-migrated to Python 3
Usage: python server-cors
'''
import http.server as httpserver
class CORSHTTPRequestHandler(httpserver.SimpleHTTPRequestHandler):
def send_head(self):
"""Common code for GET and HEAD commands.
@meain
meain / _readme.md
Created November 8, 2017 17:20 — forked from hew/_readme.md
Operator Mono w/ Italics on OSX VIm

Operator Mono w/ Italics on OSX Vim

@meain
meain / irctc.py
Created September 30, 2017 15:45 — forked from avamsi/irctc.py
Python script to semi-automate tatkal ticket booking.
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import Select, WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from time import sleep, strftime
def waituntil(s):
while strftime('%H:%M:%S') < s:
print strftime('%H:%M:%S')
sleep(1)
@meain
meain / cmd.sh
Created June 30, 2017 05:46 — forked from kelvinn/cmd.sh
Example of using Apache Bench (ab) to POST JSON to an API
# post_loc.txt contains the json you want to post
# -p means to POST it
# -H adds an Auth header (could be Basic or Token)
# -T sets the Content-Type
# -c is concurrent clients
# -n is the number of requests to run in the test
ab -p post_loc.txt -T application/json -H 'Authorization: Token abcd1234' -c 10 -n 2000 http://example.com/api/v1/locations/