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 | |
# edit this, should be login details for sms.se and your phone number | |
loginnumber="0701234567" | |
password="abc123" | |
sendTo="0701234567" | |
# you shouldn't have to edit anything beyond this point | |
if [ $# != 1 ]; then |
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() { | |
function piratify(str) { | |
return str.replace(/pp/gi, "(pp)"); | |
} | |
var tags = ['p','li','h1','h2','h3','h4','h5','h6','td','th']; | |
var texts = []; | |
for(var i = 0; i < tags.length; i++) { | |
texts = document.getElementsByTagName(tags[i]); |
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
Array.prototype.each = function(callback) { | |
var i = this.length, j = 0; | |
while(i--) { | |
callback.call(this, this[j++]); | |
} | |
}; | |
Array.prototype.contains = function(needle) { | |
var contains = false; |
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 formatString(str, values) { | |
for(var i in values) { | |
var pattern = /{/.source +i+ /}/.source; | |
str = str.replace(pattern, values[i]); | |
} | |
return str; | |
} | |
var str = "{fältnamn} är {typ}, var vänlig fyll i!"; |
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 lines = document.getElementById('textArea').value.split("\n"); | |
var prev = 0, str = "", blankLines = 0, total = ""; | |
for(var n in lines) { | |
str = b[n]; | |
if(str === "") { | |
blankLines++; | |
if(n == (lines.length-1) && blankLines !== 0) { |
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
// ----- SÅHÄR GÖR JAG NU ----- | |
while(doc != null) | |
{ | |
// söker i hela databasen varje gång | |
Document searchDoc = someDatabase.search("MYFIELD=\""+ doc.getItemValueString("MYFIELD") +"\"").getFirstDocument(); | |
// jobba med dokumentet... | |
doc = someView.getNextDocument(doc); | |
} |
NewerOlder