This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <Foundation/Foundation.h> | |
@interface ArrayIterator : NSObject | |
@property (nonatomic, strong) NSArray *array; | |
- (id) next; | |
- (NSArray *) allObjects; | |
@end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
OPENSSL_VERSION="1.0.2j" | |
curl -O https://www.openssl.org/source/openssl-$OPENSSL_VERSION.tar.gz | |
tar -xvzf openssl-$OPENSSL_VERSION.tar.gz | |
mv openssl-$OPENSSL_VERSION openssl_i386 | |
tar -xvzf openssl-$OPENSSL_VERSION.tar.gz | |
mv openssl-$OPENSSL_VERSION openssl_x86_64 | |
cd openssl_i386 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int findTop(int *flag, int i) { | |
while (flag[i] != i) i = flag[i]; | |
return i; | |
} | |
void mergeSet(int *flag, int i, int j) { | |
int x = findTop(flag, i); | |
int y = findTop(flag, j); | |
flag[x] = y; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on run {input, parameters} | |
set the_path to POSIX path of input | |
set cmd to "vim '" & the_path & "'" | |
set isRunning to (application "iTerm" is running) | |
tell application "iTerm" | |
activate | |
if isRunning then | |
if (count of windows) > 0 then | |
set sess to (current session of (create tab with default profile of current window)) | |
else |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
## Adapted from: | |
## https://mths.be/osx & https://github.com/ssorallen/dotfiles/blob/master/.osx | |
## | |
## curl -O https://gist.githubusercontent.com/ryanpcmcquen/b2e608311f286a4ab3e1/raw/.osx | |
############################################################################### | |
# General UI/UX # | |
############################################################################### |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Usage : curl -O https://gist.githubusercontent.com/CoderPiF/14ae6e3fea7e2914679b3277c19cba4a/raw/UsingRSAKeyLoginSSH.sh && sh UsingRSAKeyLoginSSH.sh | |
ConfigFile=/etc/ssh/sshd_config | |
cp ${ConfigFile} ${ConfigFile}.bak | |
sed -i -e '/RSAAuthentication/d' ${ConfigFile} | |
echo 'RSAAuthentication yes' >> ${ConfigFile} | |
sed -i -e '/PubkeyAuthentication/d' ${ConfigFile} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Usage : curl -O https://gist.githubusercontent.com/CoderPiF/f091f6ddcc80eba9be0c1d49d83179ca/raw/SetupShadowsocks.sh && sh SetupShadowsocks.sh my.shadowsocks.password | |
sudo apt-get install python-setuptools | |
curl -O https://codeload.github.com/shadowsocks/shadowsocks/tar.gz/2.9.1 | |
tar -xzf 2.9.1 | |
rm 2.9.1 | |
cd shadowsocks-2.9.1 | |
python setup.py install |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Usage : curl -O https://gist.githubusercontent.com/CoderPiF/eef90b89a93a1a699ebd738b51d02ab2/raw/my_shell_setup.sh && sh my_shell_setup.sh | |
apt-get install zsh | |
apt-get install git-core | |
wget https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | zsh | |
chsh -s `which zsh` |