Skip to content

Instantly share code, notes, and snippets.

🌴
./build

Soheil Rashidi soheilpro

View GitHub Profile
View PieView.h
#import <UIKit/UIKit.h>
@interface PieView : UIView
@property (nonatomic) double value;
@end
@soheilpro
soheilpro / gitchangename.sh
Created Mar 25, 2014
Change Git authors and committers.
View gitchangename.sh
git filter-branch -f --env-filter '
export GIT_COMMITTER_NAME="";
export GIT_AUTHOR_NAME="";
export GIT_COMMITTER_EMAIL="";
export GIT_AUTHOR_EMAIL="";
' --tag-name-filter cat -- --all
@soheilpro
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[])
{
@autoreleasepool
{
NSString* name = @"PERSON'S NAME";
NSDateComponents* birthDate = [[NSDateComponents alloc] init];
@soheilpro
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
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
soheilpro / ping.sh
Created Jul 29, 2015
Simple web site monitoring script.
View ping.sh
#!/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
URLS=(
"google|https://www.google.com"
"wikipedia|https://www.wikipedia.org"
View command.sh
git config --global alias.fu = "!f() { git commit --fixup $1; EDITOR=cat git rebase --interactive --autosquash $1~; }; f"
View keybase.md

Keybase proof

I hereby claim:

  • I am soheilpro on github.
  • I am soheilpro (https://keybase.io/soheilpro) on keybase.
  • I have a public key whose fingerprint is EEA6 88EB 1846 D21A 94FE 61BC 5CD3 FD19 5F77 2375

To claim this, I am signing this object:

View bars.json
[
{
"time": 1438415960000,
"open": 2570,
"high": 2630,
"low": 2513,
"close": 2522,
"volume": 1336207
},
{
@soheilpro
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;
@end
You can’t perform that action at this time.