Skip to content

Instantly share code, notes, and snippets.

View phanirithvij's full-sized avatar
😶‍🌫️
When you are free please let me know

Phani Rithvij phanirithvij

😶‍🌫️
When you are free please let me know
  • 07:54 (UTC +05:30)
View GitHub Profile
@codediodeio
codediodeio / config.js
Last active April 16, 2024 04:46
Snippets from the Firestore Data Modeling Course
import * as firebase from 'firebase/app';
import 'firebase/firestore';
var firebaseConfig = {
// your firebase credentials
};
// Initialize Firebase
firebase.initializeApp(firebaseConfig);
@Hollerberg
Hollerberg / Dockerfile
Created November 21, 2018 11:47
golang musl libc shared object constructor reproducer
FROM golang:1.11.2-alpine
USER root
RUN apk update && apk add musl-dbg gcc libc-dev
COPY preload.c /go
COPY gogo.go /go
COPY runtest.sh /go
RUN gcc -ggdb -fPIC -shared -o libpreload.so preload.c && go build -o gogo-int-linker gogo.go && go build -ldflags '-linkmode external' -o gogo-ext-linker gogo.go
ENTRYPOINT [ "/bin/sh" ]
@leptos-null
leptos-null / Mojave-dynamic-wallpapers.md
Last active April 29, 2021 12:26
Mojave Dynamic Desktop- How it works

Mojave Dynamic Desktop- How it works

Prompted by a tweet by NSHipster, and a subsequent thread, I wanted to find out how Mojave dynamic wallpapers worked. NSHipster and ole reverse engineered the file format. In the Twitter thread, NSHipster mentions an edge case: What happens above 66ºN (latitude)?

The first thing to do was find out what process handles the wallpaper on macOS. I primarily do iOS research, and honestly had no idea. I opened Console, searched for "solar", and then changed my static wallpaper to a dynamic one. Voila!

Message: index: 7 next: 14815.999366

Process: Dock

@bradtraversy
bradtraversy / webdev_online_resources.md
Last active May 3, 2024 12:56
Online Resources For Web Developers (No Downloading)
@phanirithvij
phanirithvij / app.py
Created July 2, 2018 11:59 — forked from liulixiang1988/app.py
upload multiple files in Flask
import os
# We'll render HTML templates and access data sent by POST
# using the request object from flask. Redirect and url_for
# will be used to redirect the user once the upload is done
# and send_from_directory will help us to send/show on the
# browser the file that the user just uploaded
from flask import Flask, render_template, request, redirect, url_for, send_from_directory
from werkzeug import secure_filename
# Initialize the Flask application
@natrim
natrim / convert.sh
Last active April 27, 2024 20:01
Simple conversion script that converts Godot html5 export to gzipped version, with decompressing wasm and pck files using pako
#!/bin/bash
### usage ./convert.sh game
## where game is baseName of the export
if [ ! "$1" ]; then
read -p 'Game name: ' game
else
game="$1"
fi
@joshtch
joshtch / gdrive-dl.py
Created January 4, 2018 02:02
Google Drive file downloader for Python, with progress bar with tqdm. Based on this SO answer https://stackoverflow.com/a/39225039/3175094
#!/usr/bin/env python2
import requests
from tqdm import tqdm
import re
import os
def download_file_from_google_drive(id, destination):
URL = 'https://docs.google.com/uc?export=download'
session = requests.Session()
@tanaikech
tanaikech / submit.md
Last active May 5, 2024 07:26
Uploading Local Files to Google Drive without Authorization using HTML Form

Uploading Local Files to Google Drive without Authorization using HTML Form

This is a sample script for uploading local file to Google Drive without the authorization using HTML form. A selected file in your local PC using HTML form is uploaded to Google Drive and saved to Google Drive.

When you use this, at first, please deploy Web Apps. The script is doPost() of following scripts.

Script : Google Apps Script

function doPost(e) {
 var data = Utilities.base64Decode(e.parameters.data);
@blinry
blinry / mpv-memento.lua
Created October 29, 2017 00:20
Put this into ~/.mpv/scripts/, then press M while playing a movie to turn on "Memento mode"
is_on = false
step = 5*60 -- seconds
overlap = 10 -- seconds
function recalc()
local pos = mp.get_property_number("time-pos")
local duration = mp.get_property_number("duration")
next_seek = math.ceil((pos+1)/step)*step+overlap
if next_seek > duration then
next_seek = duration-1
using System;
using System.Runtime.InteropServices;
using System.Windows;
using System.Windows.Interop;
using Walterlv.Demo.Interop.Native;
namespace Walterlv.Demo.Interop
{
public class WindowBlur
{