Skip to content

Instantly share code, notes, and snippets.

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

Anil anil826

🏠
Working from home
  • New Delhi , India
View GitHub Profile
//AtrributedString for different color.
NSString *str = [NSString stringWithFormat:@"You Have Selected %@", treeModel.name];
NSMutableAttributedString *message = [[NSMutableAttributedString alloc] initWithString:str];
[message addAttribute: NSForegroundColorAttributeName value:[UIColor blackColor] range:[str rangeOfString:[NSString stringWithFormat:@"%@",treeModel.name]]];
cell1.descriptionLabel.attributedText = message;
@anil826
anil826 / whateverController.m
Created May 24, 2016 09:35
differenct color in same lable using objective C
//AtrributedString for different color.
NSString *str = [NSString stringWithFormat:@"You Have Selected %@", treeModel.name];
NSMutableAttributedString *message = [[NSMutableAttributedString alloc] initWithString:str];
[message addAttribute: NSForegroundColorAttributeName value:[UIColor blackColor] range:[str rangeOfString:[NSString stringWithFormat:@"%@",treeModel.name]]];
cell1.descriptionLabel.attributedText = message;
@anil826
anil826 / makingBuil.txt
Created May 27, 2016 05:10
Uploading build on TestFlight on Itune
1) Cmd + Shift + K to do a build clean
2) after this is done, press Cmd + B to build
@anil826
anil826 / info.txt
Created June 10, 2016 06:00
change pod version
1. gem uninstall cocoapods
2. rvm get stable --auto-dotfiles
3. rvm use ruby-2.1.2
4. rvm osx-ssl-certs update all
5. rvm rubygems latest
6. sudo gem sources -r https://rubygems.org/
7. sudo gem sources -a http://rubygems.org/
8. gem install cocoapods -v 1.0.0.beta.1 --pre -V
@anil826
anil826 / pageObj.js
Created August 7, 2016 19:16
The Page Object
'use strict';
var AngularPage = function () {
browser.get('http://www.angularjs.org');
};
AngularPage.prototype = Object.create({}, {
todoText: { get: function () { return element(by.model('todoText')); }},
addButton: { get: function () { return element(by.css('[value="add"]')); }},
yourName: { get: function () { return element(by.model('yourName')); }},
@anil826
anil826 / nokogiri.md
Created August 15, 2016 21:10
Nokogiri problem in Mac OS EI captan
@anil826
anil826 / node_in_centos.md
Created August 23, 2016 06:23
Installing node version in centos 7 for Digital Ocean

su -

yum install gcc-c++ openssl-devel

cd /usr/local/src

$ wget https://raw.github.com/isaacs/nave/master/nave.sh

@anil826
anil826 / mongodump.md
Last active August 23, 2016 07:36
Easy way to create dump of mongodb database

Below method are used for creating dump of mongodb database..

mongodump --host xxx.xxx.xx.xxx --port xxxx --out /home/enbake/Documents/

mongodump --host [localhost] --port [portno] --out /home/enbake/Documents/

Below method are used for restore dump into local mongodb database..

mongorestore -d mydatabase /home/enbake/Documents/mydatabase_backup

@anil826
anil826 / amuraRubyTest.rb
Created September 19, 2016 19:00
Find the contiguous subarray within a onedimensional
# Write a RoR program to find the contiguous subarray within a onedimensional
# array of
# numbers (containing at least one positive number) which has the largest sum. For
# example
# for the sequence of values −2, 1, −3, 4, −1, 2, 1, −5, 4; the contiguous subarray with the
@anil826
anil826 / default.txt
Last active November 19, 2016 19:50
SSL setup Nginx: on NodeJs application with multiple ports
# Location of this file : /etc/nginx/sites-available/default
# This configuration for NodeJs application but the configuration is same for other framework also like ruby-on-rails.
# Make sure if you have AWS EC2 instance then please open the HTTPS port to serve the application on Https protocols.
# Also if you need extra port on same domain enable thoes port over AWS EC2 instance.
# In this configuration I am using same domain but with different port.
server {
listen 80;
server_name your.domain.com;
# return 301 https://$server_name$request_uri;