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
  • 04:10 (UTC +05:30)
View GitHub Profile
@slikts
slikts / gist:1159341
Created August 20, 2011 16:56
mangareader.net user CSS
#wrapper_header,
#adtop,
#topchapter,
#bottomchapter,
#adfooter,
#zoomer,
#wrapper_footer,
.zoomimg {
display: none;
}
@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
@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
@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" ]
@manveru
manveru / gears.go
Created May 24, 2010 13:06
Gears with SDL/OpenGL in Go
package main
import (
"sdl"
"gl"
"time"
. "math"
. "fmt"
)
@cppio
cppio / vectormagic.js
Last active February 19, 2021 06:04
Extract previews from vectormagic.com as SVG files
VecResult.prototype.toSVG = function() {
let paths = [];
this.pieces.forEach(piece => {
let index = 0;
piece.shapes.forEach(shape => {
let commands = [];
shape.lenghts.forEach(length => {
@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

package pool
type Task interface {
Execute(id int)
}
type Pool struct {
tasks chan Task
kill chan bool
}
@cbachert
cbachert / install_cacert_on_android_via_adb.sh
Created March 26, 2017 20:07
Install CAcert on android via adb
#!/bin/bash
# Compiled by following instructions on https://wiki.cacert.org/FAQ/ImportRootCert
ADB="/home/christian/android-sdk-linux/platform-tools/adb"
ROOT_CRT="cacert-root.crt"
INT_CRT="cacert-class3.crt"
curl -o "$ROOT_CRT" "https://www.cacert.org/certs/root.crt"
curl -o "$INT_CRT" "https://www.cacert.org/certs/class3.crt"
@gourneau
gourneau / python-pil-image-sprite.py
Created April 24, 2011 02:45
Make sprites of images using Python and PIL
#!/usr/bin/python
# This work is licensed under the Creative Commons Attribution 3.0 United
# States License. To view a copy of this license, visit
# http://creativecommons.org/licenses/by/3.0/us/ or send a letter to Creative
# Commons, 171 Second Street, Suite 300, San Francisco, California, 94105, USA.
# from http://oranlooney.com/make-css-sprites-python-image-library/
# Orignial Author Oran Looney <olooney@gmail.com>