Skip to content

Instantly share code, notes, and snippets.

View maximgatilin's full-sized avatar

Maxim Gatilin maximgatilin

  • @hh.ru
View GitHub Profile
@coolaj86
coolaj86 / how-to-publish-to-npm.md
Last active April 2, 2024 20:18
How to publish packages to NPM

Getting Started with NPM (as a developer)

As easy as 1, 2, 3!

Updated:

  • Aug, 08, 2022 update config docs for npm 8+
  • Jul 27, 2021 add private scopes
  • Jul 22, 2021 add dist tags
  • Jun 20, 2021 update for --access=public
  • Sep 07, 2020 update docs for npm version
@istepanov
istepanov / gist:3950977
Created October 25, 2012 07:00
Remove PHPStorm settings from Mac OS X 10.8 Mountain Lion
#!/usr/bin/sh
rm -rf "$HOME/Library/Preferences/WebIde40"
rm -rf "$HOME/Library/Caches/WebIde40"
rm -rf "$HOME/Library/Application Support/WebIde40"
rm -rf "$HOME/Library/Logs/WebIde40"
@lvivski
lvivski / jquery.mini.js
Created April 19, 2013 07:19
jQuery mini
function $(selector, context) {
return (context || document).querySelector(selector)
}
$.all = function (selector, context) {
return Array.prototype.slice.call(
(context || document).querySelectorAll(selector)
)
}
@nielswh
nielswh / new_gist_file
Created October 28, 2013 23:47
Kill node.js Process on OSX
ps aux | grep node
kill -9 PID
(Replace PID with the process Id of the Node)
@lyoshenka
lyoshenka / search-git-history.md
Last active April 26, 2024 23:16
Search Git commit history for a string and see the diffs

Searching Git commit history

This should be one of the core features of Git, but for some reason it's impossible to figure out how to search for a string in your commit history and see the diffs that that string is in. Here's the best I've come up with:

To find which commits and which files a string was added or removed in:

git log -S'search string' --oneline --name-status

To see the diff of that

@yesvods
yesvods / promise-wrap.js
Last active November 19, 2018 23:25
wrap nodejs fs#readFile to be a promise.
let fs = {
readFile: function(filename, cb){
setTimeout(()=>{
cb('hello')
}, 100)
}
}
let readFilePro = function(filename){
return new Promise(function(resolve, reject) {
fs.readFile(filename, (data, err) => {
@maogm12
maogm12 / pie-pure-css.html
Last active October 18, 2019 03:54
Pie Chart in Pure CSS
<div id="skills">
<div id="part1" class="circle animate"></div>
<div id="part2" class="circle animate"></div>
<div id="part3" class="circle animate"></div>
<div id="part4" class="circle animate"></div>
<div id="part5" class="circle animate"></div>
<div id="part6" class="circle animate"></div>
</div>
@DavidWells
DavidWells / css-with-react-checklist.md
Last active November 21, 2018 22:56
Lots of talk about different CSS solutions for React. This gist attempts to shed light on pros/cons of approaches.

Here is a checklist of all the things I need my CSS solution to handle.

I can explain any of the points. Leave a comment on the gist or tweet @DavidWells

Challenge: Take your favorite CSS solution and see how the checklist holds up.

  • Has ability Localize classes
  • Has ability to use global classes
  • Has ability to write raw CSS
  • Syntax highlighting and auto completion
@YurySolovyov
YurySolovyov / class-names.cljs
Created July 2, 2017 12:17
class-names for ClojureScript
(defn class-names [& args]
(clojure.string/join " "
(mapv name
(reduce (fn [arr arg]
(cond
(or (string? arg)
(symbol? arg)
(keyword? arg)) (conj arr arg)
(vector? arg) (vec (concat arr arg))
(map? arg) (vec (concat arr
@gricard
gricard / webpack4upgrade.md
Last active February 29, 2024 20:23
Just some notes about my attempt to upgrade to webpack 4

If you enjoyed reading this, I'm intending to do more blogging like this over here: https://cdgd.tech

This is not a complaint about Webpack or v4 in any way. This is just a record of my process trying it out so I could provide feedback to the webpack team

Hmm... I don't see any docs for 4.0 on https://webpack.js.org. I guess I'll just wing it. All I need to do is npm i -D webpack@next, right?

+ webpack@4.0.0-beta.2