Some exercises from the Falsy Values workshops.
The good parts:
- HTTP server and client in same script
- Express cookies example
- Express routing example
- Express error handling
- Express middlewares example
- Simple HTTP proxy
let { withProse } = require("./src/remark/withProse"); | |
let { withSyntaxHighlighting } = require("./src/remark/withSyntaxHighlighting"); | |
let { withTableOfContents } = require("./src/remark/withTableOfContents"); | |
let { withExamples } = require("./src/remark/withExamples"); | |
let { withLayout } = require("./src/remark/withLayout"); | |
let { withNextLinks } = require("./src/remark/withNextLinks"); | |
let { VueLoaderPlugin } = require("vue-loader"); | |
let path = require("path"); | |
const withMDX = require("@next/mdx")({ |
export const getStaticPaths: GetStaticPaths = async () => { | |
const filePaths = await getComponentMDXPaths(); | |
const paths = filePaths.map((filePath) => { | |
const extension = path.extname(filePath); | |
const name = path.basename(filePath, extension); | |
const slug = name.toLowerCase().replace(/\s/g, '-'); | |
return { params: { slug } }; | |
}); | |
return { | |
paths, |
# View registry settings | |
Get-ItemProperty HKLM:\SYSTEM\CurrentControlSet\Enum\HID\*\*\Device` Parameters FlipFlopWheel -EA 0 | |
# Change registry settings | |
# Reverse mouse wheel scroll FlipFlopWheel = 1 | |
# Normal mouse wheel scroll FlipFlopWheel = 0 | |
Get-ItemProperty HKLM:\SYSTEM\CurrentControlSet\Enum\HID\*\*\Device` Parameters FlipFlopWheel -EA 0 | ForEach-Object { Set-ItemProperty $_.PSPath FlipFlopWheel 1 } | |
# Restore default scroll direction | |
# Get-ItemProperty HKLM:\SYSTEM\CurrentControlSet\Enum\HID\*\*\Device` Parameters FlipFlopWheel -EA 1 | ForEach-Object { Set-ItemProperty $_.PSPath FlipFlopWheel 0 } |
/** | |
* Basic proof of concept. | |
* - Hot reloadable | |
* - Stateless stores | |
* - Stores and action creators interoperable with Redux. | |
*/ | |
import React, { Component } from 'react'; | |
export default function dispatch(store, atom, action) { |
#!/bin/bash | |
# https://gist.github.com/julianxhokaxhiu/c0a8e813eabf9d6d9873 | |
# Improved as per feedback from @pascal - https://gist.github.com/julianxhokaxhiu/c0a8e813eabf9d6d9873#gistcomment-3086462 | |
# brew install optipng pngcrush jpegoptim | |
find . -type f -iname "*.png" -exec optipng -nb -nc {} \; | |
find . -type f -iname "*.png" -exec pngcrush -rem gAMA -rem alla -rem cHRM -rem iCCP -rem sRGB -rem time -ow {} \; | |
find . -type f \( -iname "*.jpg" -o -iname "*.jpeg" \) -exec jpegoptim -f --strip-all {} \; |
Some exercises from the Falsy Values workshops.
The good parts:
/* | |
* Normalized hide address bar for iOS & Android | |
* (c) Scott Jehl, scottjehl.com | |
* MIT License | |
*/ | |
(function( win ){ | |
var doc = win.document; | |
// If there's a hash, or addEventListener is undefined, stop here | |
if( !location.hash && win.addEventListener ){ |
function createObservable(subscribe) { | |
return { | |
subscribe, | |
pipe: function(operator) { | |
return operator(this); | |
}, | |
}; | |
} | |
const numberObservable = createObservable(function(observer) { |
@implementation MySharedThing | |
+ (id)sharedInstance | |
{ | |
DEFINE_SHARED_INSTANCE_USING_BLOCK(^{ | |
return [[self alloc] init]; | |
}); | |
} | |
@end |