Skip to content

Instantly share code, notes, and snippets.

View paveljurca's full-sized avatar
🎯
Focusing

Pavel paveljurca

🎯
Focusing
View GitHub Profile
@originalhat
originalhat / fallacy-central.md
Created November 26, 2015 04:20
Fallacy Central

Hasty generalization

>Hasty generalization is an informal fallacy of faulty generalization by reaching an inductive generalization based on insufficient evidence—essentially making a hasty conclusion without considering all of the variables. In statistics, it may involve basing broad conclusions regarding the statistics of a survey from a small sample group that fails to sufficiently represent an entire population. Its opposite fallacy is called slothful induction, or denying a reasonable conclusion of an inductive argument (e.g. "it was just a coincidence").

@originalhat
originalhat / service-workers.md
Last active December 8, 2017 17:47
Service Workers

Service Workers

A service worker is a script that is run by your browser in the background, separate from a web page, opening the door to features which don't need a web page or user interaction. Rich offline experiences, periodic background syncs, push notifications— functionality that would normally require a native application—are coming to the web.

  • SW are are just JS workers, so they can't access the DOM directly
  • a SW can communicate w/ the pages it controls by responding to message sent via the postMessage interface
  • SW is a programmable network proxy, allowing you to conrol how network requests from your page are handled
  • it runs only when needed, and terminiates when unneeded (cannot rely on global state)
  • service workers make extense use of promises
[
[:app "cmd-t" :workspace.show]
[:app "cmd-shift-f" :searcher.show]
[:app "cmd-shift-k" :clear-console]
[:app "cmd-shift-s" :save-all]
[:app "cmd-ctrl-f" :window.fullscreen]
[:app "cmd-k" :toggle-console]
[:app "tab" :focus-last-editor]
[:workspace.focused "enter" :lt.plugins.workspace-nav/open-selection]
@cevaris
cevaris / spinner.py
Created November 12, 2015 16:45 — forked from anonymous/spinner.py
Simple Python CLI Spinner
#!/usr/bin/env python
import itertools
import sys
import time
import threading
class Spinner(object):
spinner_cycle = itertools.cycle(['-', '/', '|', '\\'])
@pierrebeaucamp
pierrebeaucamp / LeanCanvas.md
Created November 12, 2015 04:05
A Lean Canvas in markdown

Lean Canvas

The Lean Canvas is a version of the Business Model Canvas adapted by Ash Maurya specifically for startups. You can read more about it here.

Problem

Top 3 Problems

@Depicus
Depicus / clean-windows-10.ps1
Last active November 28, 2017 12:00
Clean Windows 10 for the corporate environment.
// if you are on Windows 10 you may need to start powershell as admin and run the folowing command
// Set-ExecutionPolicy RemoteSigned (see https://technet.microsoft.com/library/hh847748.aspx)
// then set back after you are done with
// Set-ExecutionPolicy Undefined
Get-AppxPackage *3dbuilder* | Remove-AppxPackage
Get-AppxPackage *windowscamera* | Remove-AppxPackage
Get-AppxPackage *officehub* | Remove-AppxPackage
Get-AppxPackage *skypeapp* | Remove-AppxPackage
Get-AppxPackage *zunemusic* | Remove-AppxPackage
var ws = require ("nodejs-websocket");
var myPort = 1337;
function handleConnection (conn) {
conn.on ("text", function (s) {
var returnstring = s.toUpperCase () + "!!!";
console.log ("handleConnection: returning " + returnstring);
conn.sendText (returnstring)
});
}
@creaktive
creaktive / wifi_rebooter.sh
Created October 28, 2015 09:27
*/1 * * * * /usr/local/bin/wifi_rebooter.sh
#!/bin/bash
# The IP for the server you wish to ping (8.8.8.8 is a public Google DNS server)
SERVER=8.8.8.8
# Only send two pings, sending output to /dev/null
ping -c2 ${SERVER} > /dev/null
# If the return code from ping ($?) is not 0 (meaning there was an error)
if [ $? != 0 ]
@superjamie
superjamie / raspberry-pi-vpn-router.md
Last active October 6, 2025 20:22
Raspberry Pi VPN Router

Raspberry Pi VPN Router

This is a quick-and-dirty guide to setting up a Raspberry Pi as a "router on a stick" to PrivateInternetAccess VPN.

Requirements

Install Raspbian Jessie (2016-05-27-raspbian-jessie.img) to your Pi's sdcard.

Use the Raspberry Pi Configuration tool or sudo raspi-config to:

@jacoby
jacoby / magicbox.pl
Created October 9, 2015 14:39
Solving my son's math homework with Recursion.
#!/usr/bin/env perl
use feature qw{ say state signatures } ;
use strict ;
use warnings ;
use utf8 ;
use Data::Dumper ;
my $numbers = [ 3 .. 11 ] ;