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
#!/usr/bin/env node | |
const chunks = [] | |
process.stdin | |
.on('data', chunk => chunks.push(chunk)) | |
.on('end', () => console.dir(eval('(' + JSON.stringify(JSON.parse(chunks.join(''))) + ')' + process.argv.slice(2).join(' ')), { colors: true, depth: null })) | |
# Example: echo '{"foo": [{"bar":[2],"baz":[1,2,3]}]}'| ./format_json.js .foo[0].baz | |
# results: [ 1, 2, 3 ] |
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
#!/bin/bash | |
echo "Kirjoita ja paina ⏎ , edellinen komento: ↑, lopetus: Ctrl-C)" | |
while true; do | |
read -e text | |
say -v Satu $text | |
history -s "$text">/dev/null | |
done |
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
// ==UserScript== | |
// @match https://extra.reaktor.fi/* | |
// ==/UserScript== | |
var link = document.createElement('style') | |
link.setAttribute('type', 'text/css') | |
link.innerHTML=[ | |
'.page-metadata ul { overflow: auto; }', | |
'.page-metadata { overflow: hidden; }' | |
].join('\n') | |
document.getElementsByTagName('head')[0].appendChild(link) |
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
// ==UserScript== | |
// @match http://jira.tallinkintra.net/secure/RapidBoard.jspa* | |
// ==/UserScript== | |
var link = document.createElement('style') | |
link.setAttribute('type', 'text/css') | |
link.innerHTML=[ | |
'.ghx-parent-group {overflow-y:auto;overflow-x:hidden;max-height:500px;}', | |
'.ghx-columns .ghx-column {padding-bottom:0;}'].join('\n') | |
document.getElementsByTagName('head')[0].appendChild(link) |
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
((function(){ | |
if(typeof window.jQuery == 'undefined') { | |
var script = document.createElement('script'); | |
script.setAttribute('src','//ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js'); | |
document.getElementsByTagName('head')[0].appendChild(script); | |
var attempts = 15; | |
;(function(){ | |
if(typeof window.jQuery == 'undefined') { | |
if(--attempts > 0) { | |
window.setTimeout(arguments.callee, 250); |
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
var __ = {} | |
function papply(func, givenArguments) { | |
var indexOf = givenArguments.indexOf(__) | |
var givenArgsSize = givenArguments.length | |
var requiredArgsSize = func.length | |
if(givenArgsSize >= requiredArgsSize && (indexOf < 0 || indexOf >= requiredArgsSize)) | |
return func.apply(func, givenArguments) | |
else | |
return function() { | |
return (function(givenArguments, remainingArguments) { |
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
var href = 'http://url.com' | |
appendStyle(href) | |
waitForStyles(loadApp) | |
function appendStyle(href) { | |
var link = document.createElement('link') | |
link.setAttribute('rel', 'stylesheet') | |
link.setAttribute('type', 'text/css') | |
link.setAttribute('href', href) | |
document.head.appendChild(link) |
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
function anagramTester(dictionary) { | |
var hash = _.groupBy(dictionary, sortStr) | |
return function(word) { | |
var sortedWord = sortStr(word) | |
return (sortedWord in hash) ? hash[sortedWord] : [] | |
} | |
function sortStr(str) { return _.map(str, _.identity).sort().join('') } | |
} |
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
<plugin> | |
<groupId>de.saumya.mojo</groupId> | |
<artifactId>gem-maven-plugin</artifactId> | |
<version>0.28.6</version> | |
<extensions>true</extensions> | |
<executions> | |
<execution> | |
<goals> | |
<goal>exec</goal> | |
</goals> |
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
<properties> | |
<bundle.rhinoJar>${project.basedir}/lib/js.jar</bundle.rhinoJar> | |
<bundle.rhinoMainClass>org.mozilla.javascript.tools.shell.Main</bundle.rhinoMainClass> | |
<bundle.rJsPath>${webappPath}/vendor/r-2.1.2.js</bundle.rJsPath> | |
</properties> | |
<profile> | |
<id>bundle-js-assets</id> | |
<build> | |
<plugins> | |
<plugin> |