This file contains hidden or 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
% brew list | while read cask; do echo -n "$cask"; awk '{printf("brew install %s\n ", $0)}'; echo ""; done | |
% brew list | while read cask; do echo -n $fg[blue] $cask $fg[white]; brew deps $cask | awk '{printf(" %s ", $0)}'; echo ";done | |
brew install apache-spark | |
brew install argtable | |
brew install arpack | |
brew install autoconf | |
brew install autojump | |
brew install automake | |
brew install awscli |
This file contains hidden or 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
package se.cehis.efsob.integration.sms; | |
import com.google.common.base.Ascii; | |
import com.google.common.base.Charsets; | |
import com.google.common.base.Throwables; | |
import com.google.common.escape.Escaper; | |
import com.google.common.net.UrlEscapers; | |
import org.apache.http.HttpEntity; | |
import org.apache.http.HttpResponse; | |
import org.apache.http.auth.AuthScope; |
This file contains hidden or 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
try { | |
final Future<SMSReplyIntegrationEntity> smsReplyIntegrationEntityFuture = sms.sendMessage("46708113432", "öäåöäasdfasfd", "efsob", "666"); | |
final SMSReplyIntegrationEntity smsReplyIntegrationEntity = smsReplyIntegrationEntityFuture.get(); | |
LOG.error("message",smsReplyIntegrationEntity.getResponseMessage()); | |
LOG.error("code",smsReplyIntegrationEntity.getResponseCode()); | |
} catch (Exception e) { | |
LOG.error("sms",e); | |
} |
This file contains hidden or 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
trait AsOption[T] { | |
type Out <: Option[_] | |
def apply(x: T): Out | |
} | |
This file contains hidden or 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
apply plugin: 'scala' | |
group = 'com.googlecode.scalascriptengine' | |
version = '1.3.1-2.10.0' | |
description = """scalascriptengine""" | |
tasks.withType(ScalaCompile) { | |
scalaCompileOptions.useAnt = false |
This file contains hidden or 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
curl --key my.se.key --cert my.se.crt --cacert ca_steria.crt -k --verbose -debug -d "fel" https://url | |
openssl s_client -host host.se -port 443 -showcerts -CAfile ca_steria.crt -key my.se.key -cert my.se.crt |
This file contains hidden or 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
SELECT | |
calendar_date birth_date, | |
current_date - birth_date Diff_Days, | |
CASE WHEN Diff_Days >= 0 THEN (Diff_Days)/7 | |
ELSE (Diff_Days +1) / 7 - 1 END | |
FROM sys_calendar.calendar | |
ORDER BY 1 |
This file contains hidden or 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
scala> List(3,4,5,8,9,10,12).sliding(2).collect{ case Seq(x, y) if(y != x + 1) => (x,y) } | |
res39: Iterator[(Int, Int)] = non-empty iterator | |
scala> .foreach(println(_) ) | |
(5,8) | |
(10,12) | |
scala> def findGaps[T <: Int](xs:List[T]) = xs.sliding(2).collect{ case Seq(x, y) if(y != x + 1) => (x,y) } | |
findGaps: [T <: Int](xs: List[T])Iterator[(T, T)] |
This file contains hidden or 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
function luhn(cardnumber) { | |
// Build an array with the digits in the card number | |
var getdigits = /\d/g; | |
var digits = []; | |
while (match = getdigits.exec(cardnumber)) { | |
digits.push(parseInt(match[0], 10)); | |
} | |
// Run the Luhn algorithm on the array | |
var sum = 0; | |
var alt = false; |
This file contains hidden or 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
import collection.GenMap | |
import scala.math | |
/** | |
* Created by IntelliJ IDEA. | |
* User: orjan | |
* Date: 2012-03-24 | |
* Time: 15:15 | |
* To change this template use File | Settings | File Templates. | |
*/ |