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 casper = require('casper').create({ | |
viewPortSize : { | |
width: 1024, | |
height: 768 | |
}, | |
onStepComplete : function(arg){ | |
show(); // THIS IS FOR CAPTURING SCREENSHOTS AFTER A STEP IS COMPLETE | |
}, | |
pageSettings : { | |
// loadImages: false // speeds up |
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 tabelajzing(a){ | |
return ["<tr>\n<th>", | |
a.map(function (e, i) { | |
return e.join("</th>\n<td>") | |
}).join("</td></tr>\n<tr>\n<th>"), | |
"</td>\n</tr>\n" | |
].join("") | |
} | |
var yourHtml = function () { |
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 exportTableToCSV($table, filename) { | |
var $rows = $table.find('tr:has(td,th)'), | |
// Temporary delimiter characters unlikely to be typed by keyboard | |
// This is to avoid accidentally splitting the actual contents | |
tmpColDelim = String.fromCharCode(11), // vertical tab character | |
tmpRowDelim = String.fromCharCode(0), // null character | |
// actual delimiter characters for CSV format |
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(){ | |
var msgs = document.querySelectorAll('swx-message'); | |
var mLen = msgs.length; | |
var out = [] | |
for (let i=0; i<mLen; i++){ | |
let r = []; | |
let m = msgs[i]; | |
let user = (m.querySelector('.tileName') && m.querySelector('.tileName').innerText.trim()) || '-'; | |
let timestamp = (m.querySelector('[data-bind^="text: setBottom"]') && m.querySelector('[data-bind^="text: setBottom"]').innerText.trim()) || ''; | |
let content = m.querySelector('.content').innerText.trim().replace(/\n/g,'\\n') || ''; |
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 sequelize={literal:()=>'',INTEGER:'INTEGER', STRING:'STRING', 'DATE':'DATE', 'DATEONLY': 'DATEONLY'}; | |
var t={'STRING':'graphql.GraphQLString', 'INTEGER':'graphql.GraphQLInt', 'DATE':'graphqlDate.GraphQLDateTime', 'DATEONLY':'graphqlDate.GraphQLDateTime'}; | |
var ql=(x)=>'{'+Object.keys(x).map(k=>(`${k} : { type : ${t[x[k].type]}, resolve(o){return o.${k}}}`)).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
import argparse | |
import random | |
import time | |
from itertools import chain | |
from pythonosc import osc_message_builder | |
from pythonosc import udp_client | |
# add easing iterators https://gist.github.com/th0ma5w/9883420 |
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
# https://github.com/RefactoringGuru/refactoring-examples/tree/master/simple/python | |
# 1 | |
def disabilityAmount(): | |
if seniority < 2: | |
return 0 | |
if monthsDisabled > 12: | |
return 0 | |
if isPartTime: | |
return 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
for file in * | |
do | |
if [ ! -d "$file" ] && [ ! "$file" == 'convert.sh' ] ; then | |
sox $file -b 16 -c 1 -r 48k "converted/$file" | |
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
const month = new Date().toDateString().split(' ')[1]; | |
const year = new Date().toDateString().split(' ')[3]; | |
if (location.href.indexOf(`github.com/maciejjankowski/${year}/wiki`) > -1) { | |
const searchToken = '# Worth checking:\n'; | |
const textarea = document.querySelector('#gollum-editor-body'); | |
const textIndex = textarea.value.indexOf(searchToken); | |
const textLength = searchToken.length; | |
textarea.value = | |
textarea.value.slice(0, textIndex + textLength) + |
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 month = new Date().toDateString().split(' ')[1]; | |
const year = new Date().toDateString().split(' ')[3]; | |
if (location.href.indexOf(`github.com/maciejjankowski/${year}/wiki`) > -1) { | |
const searchToken = '# Worth checking:\n'; | |
const textarea = document.querySelector('#gollum-editor-body'); | |
const textIndex = textarea.value.indexOf(searchToken); | |
const textLength = searchToken.length; | |
textarea.value = | |
textarea.value.slice(0, textIndex + textLength) + | |
prompt() + |
OlderNewer