Skip to content

Instantly share code, notes, and snippets.

View avinayak's full-sized avatar

Atul Vinayak avinayak

  • Hiive
  • Vancouver, BC
  • 23:30 (UTC -07:00)
View GitHub Profile
<html>
<head>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css">
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript">
function ll (argument) {
$(".bar").hover(
function(){
$(".vote").stop().animate({
left:'40px',opacity:1.0
<!DOCTYPE html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title></title>
<meta name="description" content="">
<Response>
<Say voice="alice">Welcome to Thybolt. Welcome to Thybolt. Welcome to Thybolt. Welcome to Thybolt. Welcome to Thybolt. Welcome to Thybolt. </Say>
<Play>http://demo.twilio.com/docs/classic.mp3</Play>
</Response>
@avinayak
avinayak / Installing transmission & plex in RPi for NTFS drives
Last active June 1, 2018 13:09
Installing transmission & plex in RPi for NTFS drives
install ntfs-3g from sudo apt-get install
install transmission-daemon
add next line to end of ~/.bashrc
sudo mount -t ntfs-3g -o uid=pi,gid=debian-transmission,umask=007 /dev/sda1 /mnt/d1
stop transmission daemon
sudo nano /etc/transmission-daemon/settings.json # set all folders an stuff
sudo usermod -a -G debian-transmission pi
sudo nano /etc/init.d/transmission-daemon #change USER=pi
def binsearch(a,q):
l = mid = 0
r = len(a) -1
while l<=r:
mid = (l+r)//2
if a[mid] == q:
return mid
elif a[mid]< q:
l = mid +1
elif a[mid]> q:
//go to swiggy.com
//log in
//press F12 on home page
//paste the script given below in console and press enter
//all_orders object will be populated with all your swiggy order data
all_orders=[]
recfetch = (oid)=>{
fetch('https://www.swiggy.com/dapi/order/all?order_id='+oid)
defmodule Solution do
def main do
String.split(IO.read(:stdio, :all), [" ", "\n"])
|> Enum.with_index
|> Enum.filter(fn({_,i}) -> rem(i,2) ==1 end)
|> Enum.map(fn({x,_})->x end)
|> Enum.join("\n")
|> IO.puts
end
AccelerometerManager accel;
float ax, ay, az;
void setup() {
accel = new AccelerometerManager(this);
orientation(PORTRAIT);
background (0);
fill(255);
flakes = new flake [N];
for(int i=0;i<N;i++)
import urllib.request
import urllib.parse
import json
import random
import tweepy
que = ['why', 'how', 'why', 'how', 'why', 'how', 'why', 'how',
'what', 'who', 'can', 'is', 'will', 'could', 'would']
def auto_query(que, word):
@avinayak
avinayak / recording p5js
Last active September 23, 2020 10:03
recording p5js skecthes in editor.p5js.org
### Add the snippet below in sketch.js
### optional: convert to mp4 using ffmpeg -fflags +genpts -i input.webm -r 24 out.mp4
function record(){chunks.length=0;let e=document.querySelector("#defaultCanvas0").captureStream(300),t=new MediaRecorder(e);t.ondataavailable=(e=>{e.data.size&&chunks.push(e.data)}),t.onstop=exportVideo,setTimeout(()=>{t.stop()},1e4),t.start()}function exportVideo(e){var t=new Blob(chunks),o=document.createElement("video");o.id="recorded",o.controls=!0,o.src=URL.createObjectURL(t),document.body.appendChild(o),o.play()}chunks=[],record();