Skip to content

Instantly share code, notes, and snippets.

@Xananax
Xananax / reset.css
Last active November 18, 2020 08:52
Useful CSS Reset
/**
copied from: https://meowni.ca/posts/monica-dot-css/ & https://hankchizljaw.com/wrote/a-modern-css-reset/
**/
/* Box sizing rules */
*, *::before, *::after {
box-sizing: border-box;
}
/* Remove default padding */
@Xananax
Xananax / scrape_vimeo.js
Created February 10, 2020 15:23
Scrape Vimeo Video
const load = url => new Promise((ok, err) => require('https').request({ hostname: 'player.vimeo.com', port: 443, path: `/video/${url}`, method: 'GET'}, res => {
let data = ''
res.on('data', chunk => data+=chunk.toString())
res.on('end', () => ok(data.replace(/\n/g,'')))
}).on('error',err).end());
const extractTitle = html => (/<title>(.+?) on Vimeo<\/title>/gi.exec(html) || [])[1]
const extractAuthor = titleStr => ((/(.+?) from (.+)$/.exec(titleStr)) || [titleStr, titleStr, '']).slice(1, 3)
@Xananax
Xananax / keybase.md
Last active September 13, 2019 11:17

Keybase proof

I hereby claim:

  • I am xananax on github.
  • I am xananax (https://keybase.io/xananax) on keybase.
  • I have a public key ASB_x6Y5mrLHyc5t4osR3QFWVZyy3r1E61aNNaWI2frw2Ao

To claim this, I am signing this object:

@Xananax
Xananax / Themes for CRUD.md
Created December 15, 2018 14:18
Themes for Crud
  • knifes collection: sharpness, price, material (ceramic or metal)
  • cat collection: age, color, sex
  • washing machines collection: maximum cycles per minute, price, used
  • paper collection: color, price, matte or shiny
  • toothbrushes collection: hard/soft, color, electric or not
  • potatoes collection: type of potatoe, color, age
  • beds collection: single/queen/king, feather or foam, used
  • pens collection: ink/graphite, length, color
  • pants collection: jeans/other, length of legs, length of waist, used
  • ice cubes collection: shape (star/cube/fish), water or juice, amount of electrolytes
@Xananax
Xananax / whatsapp-web-check-presence.js
Last active October 1, 2018 23:05
Check if someone comes online in whatsapp web
var audioContext = new AudioContext();
function play(frequency) {
var sampleRate = audioContext.sampleRate;
var duration = 1*sampleRate;
var numChannels = 1;
var buffer = audioContext.createBuffer(numChannels, duration, sampleRate);
var channelData = buffer.getChannelData(0);
for (var i = 0; i < sampleRate; i++) {
channelData[i]=Math.sin(2*Math.PI*frequency*i/(sampleRate));
@Xananax
Xananax / things-jad-reads.md
Last active October 1, 2018 12:30
Daily reading resources
const out = thing => console.log(JSON.stringify(thing,true,2))
/**
* checks if a string can be cast to integer
* @param {string} n
*/
const isInt = n => !isNaN(parseInt(n)) && isFinite(n);
/**
* if passed string is an integer, will cast it to an AST number
@Xananax
Xananax / readme.txt
Created September 28, 2018 20:12
Multiple Patterns (PuzzleScript Script)
Play this game by pasting the script in http://www.puzzlescript.net/editor.html
@Xananax
Xananax / readme.txt
Created September 28, 2018 20:07
Multiple Patterns (PuzzleScript Script)
Play this game by pasting the script in http://www.puzzlescript.net/editor.html
@Xananax
Xananax / readme.txt
Created September 28, 2018 20:02
Multiple Patterns (PuzzleScript Script)
Play this game by pasting the script in http://www.puzzlescript.net/editor.html