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
xmlin = prompt(); // view-source:biochemistri.es/sitemap1.xml | |
parser = new DOMParser(); | |
xmlDoc=parser.parseFromString(xmlin,"text/xml"); | |
xmlDoc.querySelectorAll('loc')[0].remove(); | |
posts = xmlDoc.querySelectorAll('loc'); | |
postlist = []; | |
for (i=0;i<posts.length;i++) {postlist.push(posts[i].innerHTML)}; | |
copy(postlist.join('\t')); // Chronological list of all posts as .tsv |
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
/* Tested with jquery-1.7.2.min.js */ | |
$(window).load(function () { | |
"use strict"; | |
/* Cycles XML file on successful load via ajax and parses contents into HTML */ | |
function parseXML(xml) { | |
/* Variable declaration */ | |
var outHTML = "", employee, sId, sFirstname, sSurname, sAddress; |
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
/* | |
Folder structure : | |
/frontend <-- AngularJS app | |
/dist <-- Production ready files | |
/assets | |
/css | |
/js | |
index.html | |
/src <-- Source files |
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
# Was asked how I keep my zshrc config sync'd between my computers with Dropbox | |
# Add a new directory in your Dropbox (or use an existing one) | |
mkdir -p ~/Dropbox/ohmyzsh | |
# move existing file to Dropbox | |
mv ~/.zshrc ~/Dropbox/ohmyzsh/zshrc | |
# symlink file back to your local directory | |
ln -s ~/Dropbox/ohmyzsh/zshrc ~/.zshrc |
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 timeAgo($time_ago) { | |
$cur_time = time(); | |
$time_elapsed = $cur_time - $time_ago; | |
$seconds = $time_elapsed ; | |
$minutes = round($time_elapsed / 60 ); | |
$hours = round($time_elapsed / 3600); | |
$days = round($time_elapsed / 86400 ); | |
$weeks = round($time_elapsed / 604800); | |
$months = round($time_elapsed / 2600640 ); | |
$years = round($time_elapsed / 31207680 ); |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<title>Document Dimension Indicator</title> | |
<style type="text/css"> | |
#dimbox { | |
position: absolute; |
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(doc, script) { | |
var js, | |
fjs = doc.getElementsByTagName(script)[0], | |
add = function(url, id) { | |
if (doc.getElementById(id)) {return;} | |
js = doc.createElement(script); | |
js.src = url; | |
js.async=true; | |
id && (js.id = id); | |
fjs.parentNode.insertBefore(js, fjs); |
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
<!-- pre-DNS resolve a domain --> | |
<link rel="dns-prefetch" href="//widget.com"> | |
<!-- pre-connect to a domain HTTP endpoint --> | |
<link rel="preconnect" href="//cdn.example.com"> | |
<!-- pre-fetch a resource, here an | |
image needed on the page --> | |
<link rel="prefetch" href="//example.com/logo.jpg" as="image"> |
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 | |
# | |
# Watch current directory (recursively) for file changes, and execute | |
# a command when a file or directory is created, modified or deleted. | |
# | |
# Written by: Senko Rasic <senko.rasic@dobarkod.hr> | |
# | |
# Requires Linux, bash and inotifywait (from inotify-tools package). | |
# | |
# To avoid executing the command multiple times when a sequence of |
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
SELECT | |
t.cid AS mid, | |
t.email_ AS email, | |
t.group_id_ AS group_id, | |
GROUP_CONCAT(t.fname_ SEPARATOR '') AS fname, | |
GROUP_CONCAT(t.lname_ SEPARATOR '') AS lname, | |
t.street_ AS street, | |
GROUP_CONCAT(t.city_ SEPARATOR '') AS city, | |
GROUP_CONCAT(t.state_code_ SEPARATOR '') AS state_code, | |
GROUP_CONCAT(t.zip_ SEPARATOR '') AS zip, |
OlderNewer