Skip to content

Instantly share code, notes, and snippets.

@kytulendu
kytulendu / install-opencl-amd.sh
Last active April 24, 2024 17:34
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.
@cobyism
cobyism / gh-pages-deploy.md
Last active April 18, 2024 13:44
Deploy to `gh-pages` from a `dist` folder on the master branch. Useful for use with [yeoman](http://yeoman.io).

Deploying a subfolder to GitHub Pages

Sometimes you want to have a subdirectory on the master branch be the root directory of a repository’s gh-pages branch. This is useful for things like sites developed with Yeoman, or if you have a Jekyll site contained in the master branch alongside the rest of your code.

For the sake of this example, let’s pretend the subfolder containing your site is named dist.

Step 1

Remove the dist directory from the project’s .gitignore file (it’s ignored by default by Yeoman).

<?
/////////////////////
// slack2html
// by @levelsio
/////////////////////
//
/////////////////////
// WHAT DOES THIS DO?
/////////////////////
//
@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:

@erikh
erikh / hack.sh
Created March 31, 2012 07:02 — forked from DAddYE/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@tomhicks
tomhicks / plink-plonk.js
Last active March 18, 2024 02:23
Listen to your web pages
@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:

@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);
});
@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
@Nakilon
Nakilon / 2048.rb
Last active July 26, 2023 22:15
2048 golfed to 379 chars in Ruby by Nakilon for http://www.reddit.com/r/tinycode/comments/22wozn/
require"io/console"
_=[[_]*4]*4
t=->{_=_.transpose}
r=->{_.map! &:reverse}
f=->{_=_.map{|_|_=(_*?\s).gsub(/\b(\d+) +\1\b/){|_|_.to_i*2}.split;_[3]||=p;_}}
f[]
loop{(0while _[i=rand(4)][j=rand(4)];_[i][j]=[*[?2]*9,?4].sample)if$n!=_*?_
system"clear"
_.map{|_|puts"%5s"*4%_}
(c=STDIN.getch)[?q]|0