This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$path="path/to/pgsql/folder" | |
$ConnectionString = "Server=127.0.0.1;Port=5432;Database=monolith_farm;Uid=postgres;Pwd=root;" | |
[Reflection.Assembly]::LoadFrom("$path/Npgsql.dll") > $null | |
function Get-CommandObject { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static string GenerateOctopusSlug(this string phrase) | |
{ | |
string str = phrase.RemoveAccent().ToLower(); | |
str = Regex.Replace(str, @"[\.+@$*%\^]", "-"); | |
// invalid chars | |
str = Regex.Replace(str, @"[^a-z0-9\s-]", ""); | |
// convert multiple spaces into one space | |
str = Regex.Replace(str, @"\s+", " ").Trim(); | |
// cut and trim |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* stop one | |
touch ~/.bash_profile | |
chmod a+x ~/.bash_profile | |
* stop two > bash_profile | |
SSHAGENT=/usr/bin/ssh-agent | |
SSHAGENTARGS="-s" | |
if [ -z "$SSH_AUTH_SOCK" -a -x "$SSHAGENT" ]; then | |
eval `$SSHAGENT $SSHAGENTARGS` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
declare | |
rindex BINARY_INTEGER; | |
slno BINARY_INTEGER; | |
totalwork NUMBER := 0; -- Total number of structures | |
worksofar NUMBER := 0; -- Number of structures processed | |
cursor cons is select * from CONSUMPTION; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// you must add this line to the build.scala :: play.Project(.........).settings(....) | |
// .settings(aspectjSettings: _*).settings(inputs in Aspectj <+= compiledClasses,products in Compile <<= products in Aspectj, products in Runtime <<= products in Compile) | |
package filters; | |
import models.User; | |
import org.aspectj.lang.JoinPoint; | |
import org.aspectj.lang.annotation.Aspect; | |
import org.aspectj.lang.annotation.Before; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public String treat(String str){ | |
final Pattern pattern = Pattern.compile("([^_.]*)[_]*"); | |
Matcher matcher = pattern.matcher(str); | |
String ret =""; | |
while(matcher.find()){ | |
if(!matcher.group(1).equals("")) | |
ret += upperFirstCharacter(matcher.group(1)); | |
} | |
return ret; |