Skip to content

Instantly share code, notes, and snippets.

View fatso83's full-sized avatar
🐢
Two toddlers. Very little time for OSS after work hours. File a PR!

Carl-Erik Kopseng fatso83

🐢
Two toddlers. Very little time for OSS after work hours. File a PR!
View GitHub Profile
'use strict'
const someFunction = function(){
return this.value;
}
function Constructor(){ };
Constructor.prototype.es = {
foobar : 'heisann',
@fatso83
fatso83 / test-sinon-issue-1528.sh
Created August 14, 2017 08:55
A test suitable for git bisect to show sinonjs/sinon#1528
#!/bin/bash
# test script built for use with `git bisect` to find a regression
# usage: git bisect start v1.16.1 v1.15.4 && git bisect run ../test-script.sh
#
# Warning: You need a Node version <= 0.12.5
# Since this script checks out former versions of Sinon, that had build scripts
# that relied on the directory layout of NPM versions < 3, it is wise to
# use `nvm` or `n` to set the current Node version to 0.12.5 or equivalent
# To support running this script when it is placed outside of the project
@fatso83
fatso83 / index.js
Created August 27, 2017 15:22
requirebin sketch
// Welcome! require() some modules from npm (like you were using browserify)
// and then hit Run Code to run your code on the right side.
// Modules get downloaded from browserify-cdn and bundled in your browser.
const mocha = require ('mocha');
const should = require ('should');
const supertest = require('supertest');
let baseUrl = supertest("http://reqres.in/");
@fatso83
fatso83 / pub-sub.js
Created October 11, 2017 09:24
Meteor pub-sub test.
// demonstrates how the local MiniMongo collection will only hold the required data necessary to fulfill
// queries on the returned data from the publication and that sort order is not prerserved, only the backing data
// tmp test
import {Mongo} from 'meteor/mongo';
import map from 'lodash/map';
console.log('start');
const Foos = new Mongo.Collection('foos');
@fatso83
fatso83 / updates.sh
Created October 25, 2017 09:20
Updates to dell xps 9360, Oct 25 2017
#before upgrade
uname -a
Linux developer-XPS-13-9360 4.10.0-37-generic #41~16.04.1-Ubuntu SMP Fri Oct 6 22:42:59 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
# followed tips on https://askubuntu.com/questions/896915/what-to-fix-with-the-fresh-factory-ubuntu-16-04-on-a-dell-xps-13-9360-qa/897439
sudo dpkg -i linux-firmware_1.164_all.deb
sudo dpkg -i linux-headers-4.13.9-041309*
sudo dpkg -i linux-image-4.13.9-041309-generic_4.13.9-041309.201710211231_amd64.deb
@fatso83
fatso83 / -
Last active November 13, 2017 11:20
Concatenate selected pages from one pdf with selected pages from another pdf
pdftk A=~/Desktop/innmeldingsskjema-andelseier-utfylt.pdf B=~/Downloads/scan-diffia.pdf cat A1 B1 output out.pdf
/* eslint-disable no-console */
const fs = require('fs');
const process = require('process');
const chalk = require('chalk');
const filename = process.env['GIT_PARAMS'].split(' ')[0];
const commit_msg = fs.readFileSync(filename).toString();
const printWarning = msg => console.warn(chalk.red(msg));
const errors = [];
class A {
constructor(arg1, arg2, argn){
console.log('A', typeof this.check)
this.arg = arg1;
this.bar = this.foo;
}
check(){
console.log('this.foo',this.foo)
@fatso83
fatso83 / external-screen-re-attach.kern.log.txt
Last active January 11, 2018 09:17
kernel logs using WD15 on Ubuntu 17.10 with kernels 4.13.0-19 and 4.13.0-21
13066-Jan 11 09:12:13 diffia9350 kernel: [30155.760444] Freezing user space processes ... (elapsed 0.004 seconds) done.
13067-Jan 11 09:12:13 diffia9350 kernel: [30155.764922] OOM killer disabled.
13068-Jan 11 09:12:13 diffia9350 kernel: [30155.764924] Freezing remaining freezable tasks ... (elapsed 0.002 seconds) done.
13069-Jan 11 09:12:13 diffia9350 kernel: [30155.767003] PM: Suspending system (mem)
13070-Jan 11 09:12:13 diffia9350 kernel: [30155.767084] Suspending console(s) (use no_console_suspend to debug)
13071-Jan 11 09:12:13 diffia9350 kernel: [30156.250396] PM: suspend of devices complete after 268.799 msecs
13072-Jan 11 09:12:13 diffia9350 kernel: [30156.273406] PM: late suspend of devices complete after 22.962 msecs
13073-Jan 11 09:12:13 diffia9350 kernel: [30156.317169] PM: noirq suspend of devices complete after 43.696 msecs
13074:Jan 11 09:12:13 diffia9350 kernel: [30156.318205] ACPI: Preparing to enter system sleep state S3
13075:Jan 11 09:12:13 diffia9350 kernel: [30156.361641] ACPI: EC: even
$ curl -s 'https://a0.muscache.com/im/pictures/470c18b0-7527-44d5-88bf-546528f8f169.jpg?aki_policy=xx_large' -o fil; file fil
fil: JPEG image data, JFIF standard 1.02, aspect ratio, density 1x1, segment length 16, progressive, precision 8, 972x960, frames 3
$ curl -s 'https://a0.muscache.com/im/pictures/470c18b0-7527-44d5-88bf-546528f8f169.jpg?aki_policy=x_large' -o fil; file fil
fil: JPEG image data, JFIF standard 1.01, aspect ratio, density 1x1, segment length 16, progressive, precision 8, 692x683, frames 3
$ curl -s 'https://a0.muscache.com/im/pictures/470c18b0-7527-44d5-88bf-546528f8f169.jpg?aki_policy=large' -o fil; file fil
fil: JPEG image data, JFIF standard 1.01, aspect ratio, density 1x1, segment length 16, progressive, precision 8, 486x426, frames 3
$ curl -s 'https://a0.muscache.com/im/pictures/470c18b0-7527-44d5-88bf-546528f8f169.jpg?aki_policy=medium' -o fil; file fil