Skip to content

Instantly share code, notes, and snippets.

@taesiri
taesiri / Change.VBA
Last active August 29, 2015 14:11
Change Font VBA
Sub Titre()
On Error Resume Next
With ActivePresentation
For i = 1 To .Slides.Count
With .Slides(i).Shapes("Slide Number Placeholder 5").TextFrame2
.TextRange.Font.Name = "IPT Lotus"
.TextRange.Font.Size = 18
.TextRange.Font.Bold = msoTrue
End With
Next i:
@taesiri
taesiri / dni.vba
Last active August 29, 2015 14:11
Do Not Indent! VBA Script for Powerpoint
Sub DontIndent()
With ActivePresentation
With .Slides(1).Shapes("Rec1").TextFrame2
.TextRange.ParagraphFormat.LeftIndent = 0
End With
End With
End Sub
@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 / GenerateData
Last active May 2, 2016 17:47
Sequential vs Random access to File
# the following code will create a file containing random integers (2**30 ~ 1 Gigabyte)
$ openssl rand -out data -base64 $((2**30 * 3/4))
# you can also use dd in linux:
$ dd if=/dev/urandom of=data bs=64M count=16
# in mac os x (lower case m)
@taesiri
taesiri / README.md
Created August 6, 2016 10:59
EvilNIC

Creates a virtual NIC, acquires an IP address from the DHCP, sets up the Squid Proxy for outgoing connection, and checks conectivity's to TARGET websites, if connection to the TARGET is lost, Repeat!

@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)