Skip to content

Instantly share code, notes, and snippets.

View sergenes's full-sized avatar
🏠
Working from home

Sergey Neskoromny sergenes

🏠
Working from home
View GitHub Profile
@sergenes
sergenes / gist:374991e4d1b13a580432
Last active August 29, 2015 14:03
How to use SSH private keys on Mac OS X
On Mac OSX, the native SSH client can use the built-in keychain directly. To add your private key to the keychain simply use the command:
ssh-add -K /path/of/private/key
As an example if your private key is stored at ~/.ssh and is named id_rsa, you would use the command:
ssh-add -K ~/.ssh/id_rsa
You will then be prompted for your passcode, which will be stored in your keychain. After this you should be ready for a password-less login.
#pragma mark - NetworkHelper.h
- (void)getHotspotNameWithCompletion:(void (^)(void))completionBlock andFail:(void (^)(void))failBlock;
#pragma mark - NetworkHelper.m
- (void)getHotspotNameWithCompletion:(void (^)(void))completionBlock andFail:(void (^)(void))failBlock
{
dispatch_async(queue, ^{
@sergenes
sergenes / Old Android RTL Alignment
Last active December 21, 2015 12:18
Old Android, how to understand that you have to fix alignment in TextView.
public class SplashActivity extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.splash);
LinearLayout layoutMain = (LinearLayout) findViewById(R.id.layoutMain);