Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@PicchiKevin
PicchiKevin / migrate.sh
Last active November 16, 2023 11:02
Heroicons v1 to v2
find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/AdjustmentsVerticalIcon/AdjustmentsVerticalIcon/g' {} +
find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/ChatBubbleBottomCenterTextIcon/ChatBubbleBottomCenterTextIcon/g' {} +
find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/ArchiveBoxIcon/ArchiveBoxIcon/g' {} +
find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/ArrowDownCircleIcon/ArrowDownCircleIcon/g' {} +
find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/ArrowLeftCircleIcon/ArrowLeftCircleIcon/g' {} +
find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/ArrowRightCircleIcon/ArrowRightCircleI
@imryanjay
imryanjay / getHBValues.js
Last active May 16, 2022 00:19
Function to get handlebar values from a template
import _ from 'lodash';
export const getHBValues = (text) => {
const re = /{{[{]?(.*?)[}]?}}/g;
const tags = [];
let matches;
while (Boolean((matches = re.exec(text)))) {
if (matches) {
tags.push(matches[1]);
}
@tomhicks
tomhicks / plink-plonk.js
Last active March 18, 2024 02:23
Listen to your web pages
@kytulendu
kytulendu / install-opencl-amd.sh
Last active January 15, 2024 09:08
A shell script to install AMDGPU-PRO OpenCL driver.
#!/bin/bash
# This script will install AMDGPU-PRO OpenCL and Vulkan support.
#
# For Ubuntu and it's flavor, just install the package using this command
# in extracted driver directory instread.
#
# ./amdgpu-pro-install --opencl=legacy,pal --headless --no-dkms
#
# For Arch Linux or Manjaro, use the opencl-amd or rocm-opencl-runtime on AUR instread.
@stolinski
stolinski / mockMang.js
Created April 9, 2018 17:27
Level Up Tutorials MockMang
import { makeExecutableSchema, addMockFunctionsToSchema } from 'graphql-tools';
import { graphql } from 'graphql';
import GraphQLMock from 'graphql-mock';
import typeDefs from 'imports/startup/both/typeDefs';
// Make a GraphQL schema with no resolvers
const schema = makeExecutableSchema({ typeDefs });
// Creates random id
const revisedRandId = () =>
@hexagon5un
hexagon5un / hull.scad
Created February 4, 2018 22:50
OpenSCAD Hull Functions Library
module multiHull(){
for (i = [1 : $children-1])
hull(){
children(0);
children(i);
}
}
module sequentialHull(){
for (i = [0: $children-2])
@connorjan
connorjan / rsub.md
Last active March 6, 2024 21:06
Editing Files Remotely via SSH on SublimeText 3

Editing Files Remotely via SSH on SublimeText 3

Sometimes you need to edit a file on a remote server, but using vim/emacs is not very practical, due to lag and speed of screen refresh.

TextMate users have the classic rmate, but it was implemented in Ruby, which may not be available on the remote server.

A better option is to use this version of rmate, implemented in pure Bash. It's a single file, self-contained, and with no external dependencies.

Step by step:

@alekseykulikov
alekseykulikov / index.md
Last active April 14, 2024 00:32
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:

<?
/////////////////////
// slack2html
// by @levelsio
/////////////////////
//
/////////////////////
// WHAT DOES THIS DO?
/////////////////////
//
@ldong
ldong / download_egghead_videos.md
Last active December 7, 2023 16:16
download egghead videos

Download videos from egghead

Go to the egghead website, i.e. Building a React.js App

run

$.each($('h4 a'), function(index, video){
  console.log(video.href);
});