Skip to content

Instantly share code, notes, and snippets.

sudo build

Soheil Rashidi soheilpro

sudo build
Block or report user

Report or block soheilpro

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
soheilpro / NSObject+Retry.h
Created May 24, 2013
A simple Objective-C category for retrying a block for n number of times.
View NSObject+Retry.h
@interface NSObject (Retry)
- (void)for:(NSInteger)times timesTryBlock:(void(^)(void(^)(NSError*)))block;
- (void)for:(NSInteger)times timesTryBlock:(void(^)(void(^)(NSError*)))block callback:(void(^)(NSError* error))callback;
soheilpro /
Created Mar 25, 2014
Change Git authors and committers.
git filter-branch -f --env-filter '
export GIT_AUTHOR_NAME="";
' --tag-name-filter cat -- --all
soheilpro /
Created Mar 25, 2014
Replace string in all Git history.
git filter-branch --tree-filter "find . -name '*.*' -exec sed -i '' -e 's/OLDSTRING/NEWSTRING/g' {} \;" -f
View PieView.h
#import <UIKit/UIKit.h>
@interface PieView : UIView
@property (nonatomic) double value;
soheilpro / main.m
Created Mar 30, 2014
Adds calendar event for Persian birthdays.
View main.m
#import <EventKit/EventKit.h>
#import <Foundation/Foundation.h>
int main(int argc, const char* argv[])
NSString* name = @"PERSON'S NAME";
NSDateComponents* birthDate = [[NSDateComponents alloc] init];
soheilpro / csvparser.js
Last active Aug 29, 2015
CSV Parser in JS
View csvparser.js
function ValueToken(value) {
this.value = value;
function CommaToken() {
function NewLineToken() {
soheilpro /
Last active May 22, 2019
Easy IIS log file format specification for goaccess.
goaccess -f u_ex150629.log --log-format "$(cat u_ex150629.log | ./" --date-format '%Y-%m-%d' --time-format '%H:%M:%S'
soheilpro / example
Created Jul 12, 2015
Convert JavaScript object to JSON
View example
echo '{name: "soheil", age: 123}' | tojson
# Output:
# {"name":"soheil","age":123}
soheilpro /
Created Jul 29, 2015
Simple web site monitoring script.
#!/usr/bin/env bash
DATE=$(TZ=Asia/Tehran date +"%Y-%m-%d %H:%M")
TIMESTAMP=$(TZ=Asia/Tehran date +"%Y%m%d%H%M")
# URLs
git config --global alias.fu = "!f() { git commit --fixup $1; EDITOR=cat git rebase --interactive --autosquash $1~; }; f"
You can’t perform that action at this time.