Skip to content

Instantly share code, notes, and snippets.

@eiriklv
eiriklv / effects-and-descriptions.js
Last active October 21, 2016 14:25
Wrapping effects to make non-deterministic/non-pure function testable and predictable (for fun and learning)
'use strict';
/**
* Dependencies
*/
const expect = require('expect');
/**
* Factory for creating an effects handling "runtime"
* that stores a retrievable effects log

Tuning Windows 10 for Slow Machines

Windows 10 on slow netbook

This guide is for those who dares to install Windows 10 on slow netbooks (1GB of RAM).
Though Windows update program is over, you still may use old Windows product keys from license stickers to install Windows 10 on old machines.

UPD Jan 2019
This article is quite old, some instructions may be obsolete.

@robinst
robinst / thread_pool_with_worker_reuse.rs
Created October 12, 2016 00:25
Rust thread pool with worker reuse for tasks that have an expensive initialization
use std::sync::mpsc;
use std::sync::mpsc::{Receiver, Sender};
use std::sync::{Arc, Mutex};
use std::thread;
fn main() {
let pool = Arc::new(Pool::new());
let mut handles = Vec::new();
@alekseykulikov
alekseykulikov / index.md
Last active February 6, 2025 21:20
Principles we use to write CSS for modern browsers

Recently CSS has got a lot of negativity. But I would like to defend it and show, that with good naming convention CSS works pretty well.

My 3 developers team has just developed React.js application with 7668 lines of CSS (and just 2 !important). During one year of development we had 0 issues with CSS. No refactoring typos, no style leaks, no performance problems, possibly, it is the most stable part of our application.

Here are main principles we use to write CSS for modern (IE11+) browsers:

@Jaykul
Jaykul / Get-MsdnKeys.ps1
Last active August 3, 2022 20:28
PowerShell + Selenium Demo: Getting Started, and reusing cookies with Invoke-Request
# It might work in 4, but I'm not testing there. Lower you'll have to tweak code
#requires -Version 5.0
param(
# Your Live ID for MSDN login
[Parameter(Mandatory)]
[PSCredential]
[System.Management.Automation.CredentialAttribute()]
$Credential,
# Pick a browser to use. Defaults to Firefox (which doesn't seem to require an external Driver file)
@nolanlawson
nolanlawson / windows.md
Last active December 28, 2018 22:24
Git/Bash/Node/npm on Windows

Git/Bash/Node/npm on Windows

Update: there's an easier way to do this. Check out my new gist instead.

How I set up my Windows 10 machine for Node development. Time to complete: about 2 hours on a fast connection.

Requirements

  • Bash, not Windows shell
@luser
luser / servo-cross-mac
Created May 26, 2016 18:29
Cross-compile Servo from Linux to OS X
#!/bin/bash
#TODO: you will need to manually get an OS X SDK.
set -e
# Install the proper Rust nightly with rustup, and add the OSX target.
rustup install nightly-`cat rust-nightly-date`
rustup override add nightly-`cat rust-nightly-date`
rustup target install x86_64-apple-darwin
@yefim
yefim / Dockerrun.aws.json
Last active April 7, 2023 16:11
Build a Docker image, push it to AWS EC2 Container Registry, then deploy it to AWS Elastic Beanstalk
{
"AWSEBDockerrunVersion": "1",
"Image": {
"Name": "<AWS_ACCOUNT_ID>.dkr.ecr.us-east-1.amazonaws.com/<NAME>:<TAG>",
"Update": "true"
},
"Ports": [
{
"ContainerPort": "443"
}
#!/bin/sh
set -e
read -p "Username: " username
read -p "Are you sure you want to add $username to all packages (y/n)? " confirm
if [ "$confirm" != "y" ]; then
echo "Ok bye."
exit 0
fi
@campaul
campaul / tarnish.rs
Created December 11, 2015 01:52
Simple HTTP proxy in Rust.
/*
Simple HTTP proxy in Rust. Hard coded to proxy rust-lang.org.
*/
extern crate hyper;
use std::io::Read;
use hyper::Client;
use hyper::header::Connection;