Skip to content

Instantly share code, notes, and snippets.

View walaura's full-sized avatar
🐝
bees

Laura buns walaura

🐝
bees
View GitHub Profile
@walaura
walaura / gist:44e7cb3cbcb99ae36904
Last active August 29, 2015 14:20
Get stats (well, msgs posted) from WA chat backups
var fs = require('fs');
var file = fs.readFileSync('chat.txt');
var lines = file.toString().split("\n");
var users = {};
lines.map(function(line){
var userArr = line.match(/-\ (.*?)\:/);
if(userArr === null || typeof userArr !== 'object') {
return;
var Slack = require('slack-client');
var slack = new Slack('your-token', true, true);
slack.on('open', function() {
for (id in slack.channels) {
if (slack.channels[id].is_member) {
console.log([id,slack.channels[id].name]);
}
}
});
@walaura
walaura / gist:5752f1d36d0707b431d3
Last active March 18, 2020 17:10
Get the most used words from whatsapp chat logs by person/global
/*
- Go to the group chat settings and email yourself the chat log
(no attachments), use that txt here.
(You'll need an android phone or some tweaking of the regex on
line 11 to make this work.)
- You might also need to create a /us folder for the --export
option to work but let's not get ahead of ourselves here.
You still havent even sent yourself the log, have you?
*/
@walaura
walaura / responsive.js
Last active September 26, 2017 10:25
(function(){
var target = 960;
var $body = document.querySelector('#container');
$body.style.width = target+'px';
$body.style.height = $body.offsetHeight+'px';
$body.style.transformOrigin = '0 0';
window.addEventListener('resize',function(ev) {
window.scaleMultiplier = window.innerWidth/target;
@walaura
walaura / custom-twitter-css.css
Created August 15, 2017 06:25
Changes the font to system default on mac, makes the topbar a bit more native-looking and removes the custom user color from the home tweet box
body {
font-family: -apple-system, sans-serif!important;
}
.topbar, .global-nav {
border-bottom: 0!important;
}
.global-nav-inner {
-webkit-backdrop-filter: blur(10px) brightness(150%);
background-color: rgba(255,255,255,.95)!important;
box-shadow: 0 1px 0 0 rgba(0,0,0,.1);
@walaura
walaura / Messager.js
Last active September 26, 2017 11:21
Extremely lazy & ugly React stores
import {add as messageAdd} from './messageStore';
import React, { Component } from 'react';
class Messager extends Component {
constructor(props) {
super(props);
messageAdd('hi');
}
@walaura
walaura / README.md
Created September 26, 2017 13:08
Cheap and easy js module loader

okay so basically this will scan for elements with a css class and attach the module to them, this pattern is v good because your module code is separate from binding, which means you can scale it up to ajax sites.

doing async imports is totes optional but it lets you have a single list of modules

@-moz-document domain("chat.google.com") {
html {
filter: invert(100%);
}
*[style*=emoji], img {
filter: invert(100%);
}
}
### Keybase proof
I hereby claim:
* I am walaura on github.
* I am walaura (https://keybase.io/walaura) on keybase.
* I have a public key ASDPo5ifHW07jAwSgSavvdstsITUeXd7R3KGMlI3hWvCego
To claim this, I am signing this object:
/*
scroll aaaall the way down in https://analytics.twitter.com/
then run this in the devtools. you can paste the data straight
into google sheets
*/
copy([...document.querySelectorAll('.DataPoint-info.metric-tweetviews')].map(_=>
_.closest('.home-group-row').querySelector('.home-group-header').innerText.replace(' SUMMARY','')
+"\t"+
_.innerText.replace(',','').replace(/\.([0-9][0-9])K/,'$10').replace(/\.([0-9])K/,'$100').replace(/\.([0-9][0-9])M/,'$10000').replace(/\.([0-9])M/,'$100000').replace('K','000').replace('M','000000')