Skip to content

Instantly share code, notes, and snippets.

View mykeels's full-sized avatar
😄
faffing!

Ikechi Michael mykeels

😄
faffing!
View GitHub Profile
const CH_BRACE_L = 0x7b as const;
const CH_BRACE_R = 0x7d as const;
const CH_SQUARE_L = 0x5b as const;
const CH_SQUARE_R = 0x5d as const;
const CH_QUOTE_D = 0x22 as const;
const CH_ESCAPE = 0x5c as const;
const CH_COMMA = 0x2c as const;
const CH_COLON = 0x3a as const;
const CH_DOT = 0x2e as const;
const CH_MINUS = 0x2d as const;

Add the target below to the project file for your dotnet core global tool. You can run this target to simplify reinstalling the global tool. You can execute this target with dotnet build -t:InstallTool.

When this target is executed the following will happen (in this order):

  • Project is packed into a NuGet package
  • Tool is uninstalled with dotnet tool uninstall
  • Tool is installed with dotnet tool install
  • Help is called on the tool just installed
@Merott
Merott / tailwind-colors-as-css-variables.md
Last active April 10, 2024 06:57
Expose Tailwind colors as CSS custom properties (variables)

This is a simple Tailwind plugin to expose all of Tailwind's colors, including any custom ones, as custom css properties on the :root element.

There are a couple of main reasons this is helpful:

  • You can reference all of Tailwind's colors—including any custom ones you define—from handwritten CSS code.
  • You can define all of your colors within the Tailwind configuration, and access the final values programmatically, which isn't possible if you did it the other way around: referencing custom CSS variables (defined in CSS code) from your Tailwind config.

See the Tailwind Plugins for more info on plugins.

@getify
getify / better-web.md
Created March 12, 2019 13:19
Building That Better Web

Building That Better Web

In honor of the 30th anniversary of the web, I wanted to share a few thoughts about what a better web could aspire to be, and challenge us to move toward it.

The Worser Web

It's tempting to frame "better" simply in terms of improvement and progress, as in how far the web has come over the last 20+ years. As a developer, I like many others get all too excited about fancy new features like Service Workers, WebRTC, and yes, even CSS Grids. The pace of change is dizzying, but it feels like a great problem to have too many awesome features to learn and use!

So in one practical respect, a better web is one that empowers developers and users alike to express themselves and connect with others more fluently.

@LordRahl90
LordRahl90 / Stack.java
Last active November 1, 2018 11:30
Implementation of stack with java. Hoping to push golang with this understanding soon.
public class Stack{
private Node head;
//I Prefer this to having to walk the length of the stack everytime.
private int length=0;
@jtanguy
jtanguy / dependency-graph-plugin.js
Created June 6, 2018 19:20
Webpack plugin to generate the dependency graph
const path = require('path');
class DependencyGraphPlugin {
apply(compiler) {
compiler.hooks.emit.tap("DependencyGraphPlugin", (compilation) => {
let deps = [];
compilation.modules.forEach(m => {
// console.log(m)
const file = path.relative('', m.resource)
@gladchinda
gladchinda / add-function-es5.js
Last active January 11, 2018 19:29
Solution to sum function challenge. Here are some examples: ( add(2) == 2 ) ( add(1)(2)(3) == 6 )
var add = function add() {
var args = Array.prototype.slice.call(arguments);
var fn = Function.prototype.bind.apply(add, [null].concat(args));
fn.valueOf = function() {
return args.reduce(function(a, b) {
return a + parseInt(b);
}, 0);
};
return fn;
}
@allengblack
allengblack / README.md
Last active January 14, 2021 16:28
Find the Isogram

Write a program that checks if a word supplied as the argument is an Isogram. An Isogram is a word in which no letter occurs more than once. Create a function called is_isogram that takes one argument, a word to test if it's an isogram. This method should return a tuple/list/array of the word and a boolean indicating whether it is an isogram. If the argument supplied is an empty string, return the argument and False, ie (argument, False). If the argument supplied is not a string, raise a TypeError with the message 'Argument should be a string'. The challenge here is to write three unique solutions, using whichever language you like. However, you must maintain the specified identifiers and error messages in the question and use the least possible number of characters to solve the problem. White space will be ignored for readability's sake.

@entropiae
entropiae / fix_git_sslread_9806.sh
Last active February 3, 2022 23:32
git: how to solve "SSLRead() return error -9806" in OSX using brew
$ brew remove git
$ brew remove curl
$ brew install openssl
$ brew install --with-openssl curl
$ brew install --with-brewed-curl --with-brewed-openssl git