Skip to content

Instantly share code, notes, and snippets.

View taesiri's full-sized avatar
😎
Keep Hacking!

Mohammad Reza Taesiri taesiri

😎
Keep Hacking!
View GitHub Profile
@taesiri
taesiri / enableHTML5AppCache.java
Created October 10, 2016 08:14 — forked from jaydeepw/enableHTML5AppCache.java
Enabling HTML5 AppCache in Android Webview programatically.
private void enableHTML5AppCache() {
webView.getSettings().setDomStorageEnabled(true);
// Set cache size to 8 mb by default. should be more than enough
webView.getSettings().setAppCacheMaxSize(1024*1024*8);
// This next one is crazy. It's the DEFAULT location for your app's cache
// But it didn't work for me without this line
webView.getSettings().setAppCachePath("/data/data/"+ getPackageName() +"/cache");
@taesiri
taesiri / randomtest.py
Created November 29, 2016 08:51
A renderdoc python script to visit every event and do some work
# Jumps to every event in turn, optionally doing work at each point
import time
import random
do_vert_debug = 1
do_pixel_debug = 1
action_chance = 0.333
x = 0
@taesiri
taesiri / README.md
Created March 26, 2017 09:14 — forked from ryansch/README.md
neovim + yadr
@taesiri
taesiri / 0_reuse_code.js
Created May 13, 2017 07:07
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@taesiri
taesiri / iterm2.zsh
Created June 19, 2017 17:24 — forked from wadey/iterm2.zsh
Change iTerm2 tab color when using SSH
# Usage:
# source iterm2.zsh
# iTerm2 window/tab color commands
# Requires iTerm2 >= Build 1.0.0.20110804
# http://code.google.com/p/iterm2/wiki/ProprietaryEscapeCodes
tab-color() {
echo -ne "\033]6;1;bg;red;brightness;$1\a"
echo -ne "\033]6;1;bg;green;brightness;$2\a"
echo -ne "\033]6;1;bg;blue;brightness;$3\a"
@taesiri
taesiri / tmux-cheatsheet.markdown
Created June 25, 2017 13:25 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@taesiri
taesiri / ffmpeg-gun.py
Created June 28, 2017 19:41
Quick and dirty code to extract all frames from mp4 files recusively
from __future__ import print_function
import sys
import os
from glob import glob
import subprocess
ffmpeg_binary = "C:\\Windows\\System32\\ffmpeg.exe"
working_path = sys.argv[1:][0]
mp4_files = [y for x in os.walk(working_path) for y in glob(os.path.join(x[0], '*.mp4'))]
@taesiri
taesiri / farsnews_harvester.py
Last active July 8, 2017 11:19
Hacky script for gathering some textual data!
from __future__ import print_function
import urllib2
import HTMLParser
import os
import sys
import httplib2
import io
from bs4 import BeautifulSoup
fars_news_website = 'http://www.farsnews.com'
@taesiri
taesiri / fftube.py
Last active August 24, 2017 12:20
Extract frames from youtube videos
import argparse
import youtube_dl
import ffmpy
samples_per_video = 10
game_dic = {}
def save_frame(url, time, game_name):
if game_name not in game_dic.keys():
game_dic[game_name] = 0
@taesiri
taesiri / Readme.md
Last active October 15, 2017 13:34
gpu.js Hello World!

gpu.js Hello World

Hello World sample in gpu.js

Screenshot