Skip to content

Instantly share code, notes, and snippets.

View prayagupa's full-sized avatar
💭
Neta

Prayag prayagupa

💭
Neta
View GitHub Profile
[1] ADD
http://sachachua.com/blog/2011/01/emacs-24-package-manager/
[2]
M-x package-list-packages
[3]
https://github.com/hvesalai/scala-mode2
@prayagupa
prayagupa / .vimrc.md
Last active February 14, 2017 17:53
JVM Tech Stack install on fresh ubuntu in a single ENTER, VIM, VIMrc

Install tmux

sudo apt-get install tmux
git clone https://github.com/seebi/tmux-colors-solarized
cat tmuxcolors-256.conf >> ~/.tmux.conf

##for maximizing and restoring panes.
  unbind +
  bind + new-window -d -n tmp \; swap-pane -s tmp.0 \; select-window -t tmp
  unbind -
[NOT_REQ]
prayag@prayag:~$ sudo adduser prayag www-data
[sudo] password for prayag:
Adding user `prayag' to group `www-data' ...
Adding user prayag to group www-data
Done.
prayag@prayag:~$ sudo chown -R www-data:www-data /var/www
prayag@prayag:~$ sudo chmod -R g+rw /var/www
@prayagupa
prayagupa / gradle-spring.sh
Last active December 16, 2015 01:18
Gradle Spring
http://springsourcery.org/springSourcery/content/viewContent,1,4.html?random=6821
[2]
prayag@prayag:~/hacker_/gradle-pring$ sudo mkdir eccount-controller && sudo mkdir eccount-view && sudo mkdir eccount-core
prayag@prayag:~/hacker_/gradle-pring$ ls -l
total 12
drwxr-xr-x 2 root root 4096 Apr 10 16:47 eccount-controller
drwxr-xr-x 2 root root 4096 Apr 10 16:47 eccount-core
drwxr-xr-x 2 root root 4096 Apr 10 16:47 eccount-view
@prayagupa
prayagupa / Hardware.md
Last active November 9, 2021 18:11
Linux, Unix, inode, alias, CPU, GPU, tty, pty

Mac/Unix

$ getconf LONG_BIT
64
$ sysctl hw | grep cpu
hw.ncpu: 8
@prayagupa
prayagupa / _form.gsp
Created August 3, 2013 18:34
Grails Image Display
<g:if test="${studentInstance?.photo}">
<img src="${resource(dir:'/var/www/avatars', file:fieldValue(bean:studentInstance, field:'photo'))}" />
</g:if>
1 #!/bin/sh
2 declare -a files=("eccount-gwt/src/main/java/com/eccount/eccount.gwt.xml" "eccount-gwt/src/main/java/com/eccount/eccountAdmin.gwt.xml" "eccount-gwt/src/ma in/java/com/eccount/eccountBankUser.gwt.xml" "eccount-gwt/src/main/java/com/eccount/eccountMerchant.gwt.xml")
3
4 for file in "${files[@]}"
5 do
6 echo "Setting agent to " $file
7 FN=$file;
8 NL=$(wc -l "$FN");
9 sed -i ${NL%% *}'i\ <set-property name="user.agent" value="safari" />' "$FN"
10 done
@prayagupa
prayagupa / grails hacks.md
Last active December 24, 2015 16:29
grails hacks
This is an example how to perform multi-select faceting in ElasticSearch.
Selecting multiple values from the same facet will result in an OR filter between each of the values:
(facet1.value1 OR facet1.value2)
Faceting on more than one facet will result in an AND filter between each facet:
(facet1.value1 OR facet1.value2) AND (facet2.value1)
I have chosen to update the counts for each facet the selected value DOES NOT belong to since we are performing an AND between each facet. I have included an example that shows how to keep the counts if you don't want to do this (filter0.sh).
@prayagupa
prayagupa / EventDriven.md
Last active January 29, 2018 00:41
scala, scala 101
scala> import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent.ExecutionContext.Implicits.global

scala> import scala.concurrent.Future
import scala.concurrent.Future

scala> import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent.ExecutionContext.Implicits.global