Skip to content

Instantly share code, notes, and snippets.

View anistark's full-sized avatar
💻
Open Innovation and Development

Ani anistark

💻
Open Innovation and Development
View GitHub Profile
@anistark
anistark / gist:95bf5d194478aad713e1
Created February 1, 2016 11:33 — forked from iwasrobbed/gist:1032395
Amazon S3 Query String Authentication for Ruby on Rails
def generate_secure_s3_url(s3_key)
#
# s3_key would be a path (including filename) to the file like: "folder/subfolder/filename.jpg"
# but it should NOT contain the bucket name or a leading forward-slash
#
# this was built using these instructions:
# http://docs.amazonwebservices.com/AmazonS3/latest/dev/index.html?S3_QSAuth.html
# http://aws.amazon.com/code/199?_encoding=UTF8&jiveRedirect=1
s3_base_url = MyApp::Application::S3_BASE_URL # i.e. https://mybucket.s3.amazonaws.com
@anistark
anistark / bash_profile.txt
Created January 20, 2016 06:40
Basic Bash Profile
if [ -z "$SSH_AUTH_SOCK" ] ; then
eval `ssh-agent -s`
ssh-add ~/.ssh/delivery
fi
if [ -f ~/.bashrc ]; then
source ~/.bashrc
fi
@anistark
anistark / slackforubuntu.sh
Created November 9, 2015 13:46
Slack For Ubuntu Install Script
sudo apt-get update;sudo apt-add-repository -y ppa:rael-gc/scudcloud;sudo apt-get update;sudo apt-get install scudcloud;sudo apt-get install hunspell-en-us;sudo dpkg-divert --add --rename --divert /opt/scudcloud/resources/scudcloud.png.real /opt/scudcloud/resources/scudcloud.png;sudo cp ~/Downloads/scudcloud.png /opt/scudcloud/resources/;sudo chmod +r /opt/scudcloud/resources/scudcloud.png
@anistark
anistark / git-tricks.md
Last active June 22, 2017 13:19
Git Tips and Tricks

Git Tips and Tricks

Collection of most used git commands

Everyday Git in twenty commands or so

git help everyday

Overwrite pull

@anistark
anistark / objectOrientedProgramming.md
Created October 26, 2015 08:44
What is Object Oriented Programming?

In an excerpt from a 1994 Rolling Stone interview, Jobs explains what object-oriented programming is.

Jeff Goodell: Would you explain, in simple terms, exactly what object-oriented software is?

Steve Jobs: Objects are like people. They’re living, breathing things that have knowledge inside them about how to do things and have memory inside them so they can remember things. And rather than interacting with them at a very low level, you interact with them at a very high level of abstraction, like we’re doing right here. Here’s an example: If I’m your laundry object, you can give me your dirty clothes and send me a message that says, “Can you get my clothes laundered, please.” I happen to know where the best laundry place in San Francisco is. And I speak English, and I have dollars in my pockets. So I go out and hail a taxicab and tell the driver to take me to this place in San Francisco. I go get your clothes laundered, I jump back in the cab, I get back here. I give you your clean clothes and say,

@anistark
anistark / .bashrc
Last active July 8, 2018 03:03
Tmux Conf
# Tmux Config
tm() { tmux new -s "$1" ;}
ta() { tmux attach -t "$1"; }
tl() { tmux list-sessions; }
@anistark
anistark / sublimeText.md
Last active February 19, 2016 07:57
Setup Sublime Text

Install via the Package Manager(apt-get):

Simply add to your packages:

For Sublime-Text-2:

sudo add-apt-repository ppa:webupd8team/sublime-text-2
sudo apt-get update
sudo apt-get install sublime-text
@anistark
anistark / nodeErrors.md
Created October 14, 2015 07:43
Common Node Errors

watch ENOSPC error

cause :

The system has a limit to how many files can be watched by a user. You can run out of watches pretty quickly if you have Grunt running with other programs like Dropbox. This command increases the maximum amount of watches a user can have.

Solution :

@anistark
anistark / LampSetup.md
Last active September 20, 2016 07:24
LAMP Setup

Install Apache

sudo apt-get update
sudo apt-get install apache2

Install Mysql

@anistark
anistark / express_new_project.md
Last active October 10, 2015 17:03
Creating new project in nodejs and express

express -c stylus <project_name>

cd <project_name>

npm install

npm start