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 as = ""; var s = false; var t; var f; var c = function() { f = $("#f").contentWindow; var ts = ($(".fbLastActiveTimestamp", f.document).childNodes[0].data == "active now"); if (s != ts) { s = ts; var cd = new Date(); var st = (s ? "online" : "offline") + "," + cd.getHours() + ":" + cd.getMinutes(); console.log(st); as += st + "\n"; } f.location.reload(); }; var stop = function() { clearInterval(t); }; var start = function() { $("body").insertAdjacentHTML('afterbegin', '<iframe id="f" src="https://m.facebook.com/messages/read/?tid=id.289725077795063"></iframe>'); t = setInterval(c, 30 * 1000); }; start(); |
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 as = ""; var s = false; var t; var c = function() { var f = $("#f").contentWindow; var ts = ($(".fbLastActiveTimestamp", f.document).childNodes[0].data == "active now"); var cd = new Date(); var st = cd.getHours() + ":" + cd.getMinutes() + "," + (s ? "online" : "offline"); console.log(st); as += st + "\n"; f.location.reload(); }; var stop = function() { clearInterval(t); }; var start = function() { $("body").insertAdjacentHTML('afterbegin', '<iframe id="f" src="https://m.facebook.com/messages/read/?tid=id.289725077795063"></iframe>'); t = setInterval(c, 60 * 1000); }; start(); |
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
apt-get update | |
apt-get install nodejs -y | |
apt-get install npm -y | |
ln -s /usr/bin/nodejs /usr/bin/node | |
npm install | |
npm install -g grunt-cli | |
npm install forever -g | |
apt-get install ruby -y | |
gem install sass --no-ri --no-rdoc | |
grunt |
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
mkdir tmp | |
cd tmp | |
wget http://downloads.sourceforge.net/project/wkhtmltopdf/0.12.2.1/wkhtmltox-0.12.2.1_linux-trusty-amd64.deb -O x.deb | |
ar vx x.deb | |
tar xf data.tar.xz | |
mv usr/local/bin/* ../ | |
cd .. | |
rm -rf tmp |
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
apt-get update | |
apt-get install nodejs -y | |
apt-get install npm -y | |
npm install http-server -g | |
ln -s /usr/bin/nodejs /usr/bin/node | |
echo "Hello, World" > index.html | |
http-server -p 80 |
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
for i in $(/usr/bin/find $(pwd) -maxdepth 1 -type d); do | |
if [ $(pwd) != $i ] | |
then | |
cd "${i##*/}"; | |
git remote set-url origin "git@github.com:OrganisationName/${i##*/}.git" | |
git remote -v; | |
cd ..; | |
fi | |
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
<!-- BASED ON https://codepen.io/2ne/pen/osvpj --> | |
<html> | |
<head> | |
<style> | |
.ios { | |
font-family: sans-serif; | |
line-height: 26px; | |
position: relative; | |
width: 500px; |
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 | |
# output: id, name, age | |
DATABASE_PATH="database.db"; | |
TABLE_NAME="table"; | |
LIST=$(sqlite3 $DATABASE_PATH "PRAGMA table_info($TABLE_NAME)"); | |
for ROW in $LIST; do | |
printf $ROW | awk '{split($0,a,"|"); printf "%s, ", a[2]}'; | |
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
'use strict'; | |
async function boot () { | |
async function getName () { | |
if (false) { | |
return new Promise( | |
resolve => { | |
setTimeout(() => resolve('James'), 1000); | |
} |
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
const Hapi = require('hapi'); | |
const allowedOrigins = []; | |
const middleware = function addCorsHeaders (request, reply) { | |
// not cors | |
if (!request.headers.origin) { | |
return reply.continue() | |
} |
OlderNewer