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
on sansExt(theFileName) | |
do shell script "file=" & theFileName & ";" & "echo ${file%.*}" | |
end sansExt | |
on run argv | |
set keynote_path to (item 1 of argv) | |
set out_path to (item 2 of argv) | |
set extension to (item 3 of argv) | |
set basename to sansExt(out_path) |
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
// Count packages with most class definitions (excluding class definitions in java.lang.*) | |
var set = {}; | |
top(map(unique(map(filter(heap.classes(), function(it) { | |
return !it.name.substr(0,it.name.lastIndexOf('.')).startsWith('java.lang'); | |
}), function(it) { | |
var pName = it.name.substr(0,it.name.lastIndexOf('.')); | |
if (set[pName]) { | |
set[pName]++; | |
} else { |
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
# add public key to dokku | |
cat /path/to/public_key | ssh root@yourdokkuinstance "sudo sshcommand acl-add dokku [description]" |
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
# TODO: Get rid of last quotation mark output | |
$ curl -s http://localhost:8080/|grep -oP '_csrf" value="\K.*"'`' |
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
#F1::Send {Volume_Mute} | |
#F2::Send {Volume_Down 3} | |
#F3::Send {Volume_Up 3} | |
#F4::Send {Media_Play_Pause} | |
#F5::Send {Media_Prev} | |
#F6::Send {Media_Next} |
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
/** | |
* Bruk en extenstion som stylebot e.l. i Chrome og legg til følgende regler for aftenposten.no for å lese Magasinet-artikler | |
*/ | |
.js-salesposter-blurred-element { | |
text-shadow: 0 0 #000; | |
opacity: 1; | |
color: #000; | |
} |
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
// http://stackoverflow.com/questions/1983839/determine-which-jar-file-a-class-is-from | |
Class klass = String.class; | |
URL location = klass.getResource('/'+klass.getName().replace('.', '/')+".class"); |
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
Ext.override(Ext.data.Connection, { | |
timeout:120000 | |
}) |
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
import org.springframework.beans.*; | |
import org.springframework.dao.DataRetrievalFailureException; | |
import org.springframework.dao.InvalidDataAccessApiUsageException; | |
import org.springframework.jdbc.core.BeanPropertyRowMapper; | |
import org.springframework.jdbc.support.JdbcUtils; | |
import org.springframework.util.Assert; | |
import org.springframework.util.StringUtils; | |
import java.beans.PropertyDescriptor; | |
import java.lang.reflect.Field; |
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 Result acceptedLanguages() throws IOException { | |
Map<String, Object> stuff = new HashMap<>(); | |
stuff.put("profilepage.profile.button.connect", Messages.get("profilepage.profile.button.connect")); | |
stuff.put("acceptedLanguages header", request().headers().containsKey("Accept-Language")?request().headers().get("Accept-Language")[0]:"non-existant"); | |
stuff.put("play.mvc.Http.Context.current().request().cookies()", Http.Context.current().request().cookies()); | |
List<Lang> availables = Lang.availables(); | |
Collection<Locale> transform = Collections2.transform(availables, new Function<Lang, Locale>() { | |
@Override | |
public Locale apply(Lang lang) { | |
return lang.toLocale(); |
NewerOlder