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 / glui.rkt
Created November 27, 2013 11:10 — forked from tonyg/2d.rkt
#lang racket/base
;; Experimentation with OpenGL for widgetry.
(require racket/class)
(require racket/gui/base)
(require sgl)
(require sgl/gl-vectors)
(define c%
(class canvas%

Intro

To view the progress of a Powerpoint presentation, a progress bar can be displayed at the bottom of the slide show.

How to proceed

Once the slideshow is complete, go to Tools > Macro > Visual Basic Editor.

In the new window, select Insert > Module and copy this text in the blank page:

Sub AddProgressBar()
    On Error Resume Next
@taesiri
taesiri / tmux_cheatsheet.markdown
Last active August 29, 2015 14:26 — forked from henrik/tmux_cheatsheet.markdown
tmux cheatsheet

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@taesiri
taesiri / gist:9c0dad43d0209896e817
Created October 8, 2015 21:08 — forked from atcuno/gist:3425484ac5cce5298932
HowTo: Privacy & Security Conscious Browsing

The purpose of this document is to make recommendations on how to browse in a privacy and security conscious manner. This information is compiled from a number of sources, which are referenced throughout the document, as well as my own experiences with the described technologies.

I welcome contributions and comments on the information contained. Please see the How to Contribute section for information on contributing your own knowledge.

Table of Contents

@taesiri
taesiri / How-to-building-CUDA7.5-with-clang7.0.0.md
Created October 21, 2015 06:30 — forked from zchee/How-to-building-CUDA7.5-with-clang7.0.0.md
How to compiling use CUDA nvcc with Xcode7.0 clang 7.0.0

CUDA7.5

Now, CUDA did not compatible Apple clang 7.0.0 also Xcode7.0.

e.g,

> cd /Developer/NVIDIA/CUDA-7.5/samples/0_Simple/asyncAPI

> clang -v
Apple LLVM version 7.0.0 (clang-700.1.75)
@taesiri
taesiri / testprof.m
Created January 12, 2016 14:48 — forked from markd2/testprof.m
code coverage on the command line
#import <stdio.h>
// xcrun clang -g -Wall -Werror -fprofile-instr-generate -fcoverage-mapping -o testprof testprof.m
// ./testprof
// xcrun llvm-profdata merge -o testprof.profdata default.profraw
// xcrun llvm-cov show ./testprof -instr-profile=testprof.profdata testprof.m
static int DoSomething (int value) {
if (value == 55) {
@taesiri
taesiri / churn script
Created January 16, 2016 14:14 — forked from coreyhaines/churn script
Bash script to generate churn counts in git repo
churn number and file name
git log --all -M -C --name-only | grep -E '^(app|lib)/' | sort | uniq -c | sort | awk 'BEGIN {print "count,file"} {print $1 "," $2}'
churn number and file name w/ limiting to last n commits
git log --all -n 5000 -M -C --name-only | grep -E '^spec/models' | sort | uniq -c | sort | awk 'BEGIN {print "count,file"} {print $1 "," $2}'
graph of churn number and frequency
git log --all -M -C --name-only | grep -E '^(app|lib)/' | sort | uniq -c | sort | awk '{print $1}' | uniq -c | sort | awk 'BEGIN { print "frequency,churn_count"} { print $1,$2}'
@taesiri
taesiri / TestPattern.cpp
Created October 6, 2016 11:08 — forked from roxlu/TestPattern.cpp
Example usage of X264. We create a raw YUV pattern and encode it with x264.
#include <cmath>
#include <assert.h>
#include <core/TestPattern.h>
TestPattern::TestPattern()
:w(0)
,h(0)
,frame_num(0)
,duration(0)
@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