Skip to content

Instantly share code, notes, and snippets.

http {
proxy_cache_path /var/cache/nginx levels=1:2 keys_zone=one:8m max_size=3000m inactive=600m;
proxy_temp_path /var/tmp;
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
gzip on;
gzip_comp_level 6;
gzip_vary on;
@pratik60
pratik60 / assets.json
Created July 23, 2014 07:58
Bower json
{
"core": {
"css": {
"bower_components/build/css/dist.min.css": [
"bower_components/angular-xeditable/dist/css/xeditable.css",
"bower_components/ngAnimate/ng-animation.css",
"bower_components/angular-emoticons/stylesheets/angular-emoticons.css",
"bower_components/font-awesome/css/font-awesome.min.css",
"bower_components/select2/select2.css"
]
@pratik60
pratik60 / likes.js
Created July 19, 2014 11:46
multiple resources
'use strict';
angular.module('mean.likes').factory('Likes', ['$resource',
function($resource) {
return {
like: $resource('like/:referenceType/:referenceId/:userId', {
referenceType: '@referenceType',
referenceId: '@referenceId',
userId: '@userId'
}),
{
"bold_folder_labels": true,
"caret_style": "wide",
"color_scheme": "Packages/User/Espresso Soda.tmTheme",
"default_line_ending": "unix",
"detect_slow_plugins": false,
"draw_white_space": "all",
"ensure_newline_at_eof_on_save": true,
"fade_fold_buttons": false,
"fallback_encoding": "UTF-8",
@pratik60
pratik60 / gist:99f018ea54a71b4e9f12
Created June 24, 2014 15:41
multiselect-css-drupal
body.page-node-add .ui-multiselect.ui-widget.ui-state-default.ui-corner-all,
body.page-node-edit .ui-multiselect.ui-widget.ui-state-default.ui-corner-all,
body.page-node-custom-alert .ui-multiselect.ui-widget.ui-state-default.ui-corner-all,
body.page-workflow-dashboard .ui-multiselect.ui-widget.ui-state-default.ui-corner-all{
width: 500px !important;
height: 40px !important;
}
body.page-node-add .ui-multiselect-filter input,
body.page-node-edit .ui-multiselect-filter input,
@pratik60
pratik60 / .htaccess
Created June 23, 2014 08:14
Htaccess
#
# Apache/PHP/Drupal settings:
#
# Protect files and directories from prying eyes.
<FilesMatch "\.(engine|inc|info|install|make|module|profile|test|po|sh|.*sql|theme|tpl(\.php)?|xtmpl)(~|\.sw[op]|\.bak|\.orig|\.save)?$|^(\..*|Entries.*|Repository|Root|Tag|Template)$|^#.*#$|\.php(~|\.sw[op]|\.bak|\.orig\.save)$">
Order allow,deny
</FilesMatch>
# Don't show directory listings for URLs which map to a directory.
@pratik60
pratik60 / package manager st3
Created June 20, 2014 05:56
package manager st3
import urllib.request,os,hashlib; h = '7183a2d3e96f11eeadd761d777e62404' + 'e330c659d4bb41d3bdf022e94cab3cd0'; pf = 'Package Control.sublime-package'; ipp = sublime.installed_packages_path(); urllib.request.install_opener( urllib.request.build_opener( urllib.request.ProxyHandler()) ); by = urllib.request.urlopen( 'http://sublime.wbond.net/' + pf.replace(' ', '%20')).read(); dh = hashlib.sha256(by).hexdigest(); print('Error validating download (got %s instead of %s), please try manual install' % (dh, h)) if dh != h else open(os.path.join( ipp, pf), 'wb' ).write(by)
@pratik60
pratik60 / package manager
Created June 20, 2014 05:52
install package manager
import urllib2,os,hashlib; h = '7183a2d3e96f11eeadd761d777e62404' + 'e330c659d4bb41d3bdf022e94cab3cd0'; pf = 'Package Control.sublime-package'; ipp = sublime.installed_packages_path(); os.makedirs( ipp ) if not os.path.exists(ipp) else None; urllib2.install_opener( urllib2.build_opener( urllib2.ProxyHandler()) ); by = urllib2.urlopen( 'http://sublime.wbond.net/' + pf.replace(' ', '%20')).read(); dh = hashlib.sha256(by).hexdigest(); open( os.path.join( ipp, pf), 'wb' ).write(by) if dh == h else None; print('Error validating download (got %s instead of %s), please try manual install' % (dh, h) if dh != h else 'Please restart Sublime Text to finish installation')
@pratik60
pratik60 / installwithdrush
Created June 19, 2014 11:09
Drupal Installation
cd /var/www
drush dl drupal --drupal-project-rename=d7
cd d7
drush si -y --db-url=mysql://root:personofinterest@localhost/d7
drush upwd admin --password="admin"
//Maybe you need this
cd sites/default
@pratik60
pratik60 / .gitignore
Created June 19, 2014 08:12
Gitignore for drupal
# Ignore emacs backup files...
*~
# Ignore configuration files that may contain sensitive information.
sites/*/settings.php
# Ignore paths that contain user-generated content.
.sass-cache/*
sites/*/files
sites/*/private