Skip to content

Instantly share code, notes, and snippets.

View ilyazub's full-sized avatar
๐ŸŒ
๐Ÿ‡บ๐Ÿ‡ฆ๐Ÿ‡ต๐Ÿ‡ฑ๐ŸŒŒ

ilyazub

๐ŸŒ
๐Ÿ‡บ๐Ÿ‡ฆ๐Ÿ‡ต๐Ÿ‡ฑ๐ŸŒŒ
View GitHub Profile
scriptencoding utf-8
" To install nvim on ubuntu:
" sudo apt-get install software-properties-common
" sudo add-apt-repository ppa:neovim-ppa/unstable
" sudo apt-get update
" sudo apt-get install neovim
" sudo apt-get install python-dev python-pip python3-dev python3-pip
" sudo update-alternatives --install /usr/bin/vi vi /usr/bin/nvim 60
" sudo update-alternatives --config vi
@nadavmatalon
nadavmatalon / .gitattributes
Created October 24, 2016 23:08
Github: Exclude Folder from Repo's Language Statistics
extras/* linguist-documentation
@jeteon
jeteon / google-maps-data-parser.js
Last active October 15, 2025 17:51
NodeJS script to parse the Google Maps "data" URL attribute into an array.
'use strict';
/**
* Basic code to parse the values in the "data" attribute in a Google Maps URL to an Array.
* There will likely still be some work to do to interpret the resulting Array.
*
* Based on information from:
* http://stackoverflow.com/a/34275131/1852838
* http://stackoverflow.com/a/24662610/1852838
*/
@gonzalocasas
gonzalocasas / fire_and_forget.rb
Created May 30, 2016 23:18
Fire And Forget HTTP requests on Ruby
require 'socket'
require 'uri'
def fire_and_forget_post(url, body)
uri = URI.parse(url)
req = []
port = ":#{uri.port}" if uri.port != 80
req << "POST #{uri.request_uri} HTTP/1.1"
req << "Host: #{uri.host}#{port}"
@manfe
manfe / helper.rb
Last active January 14, 2020 10:15
Rails Helper to build Hierachical HTML List
module TreeListHelper
# the collection need to be the root parents
def tree_list(collection)
content_tag(:ul) do
collection.each do |item|
if item.children.any?
concat(
content_tag(:li, id: item.id) do
concat(item.name)
concat(tree_list(item.children))
@craigbeck
craigbeck / introspection-query.graphql
Created April 6, 2016 20:20
Introspection query for GraphQL
query IntrospectionQuery {
__schema {
queryType { name }
mutationType { name }
subscriptionType { name }
types {
...FullType
}
directives {
@rosswd
rosswd / laptops.md
Last active June 22, 2024 23:10
Linux Laptops
@paulirish
paulirish / what-forces-layout.md
Last active October 20, 2025 10:03
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
@palkan
palkan / gist:d89757a90cfbeb047c63
Last active January 27, 2025 07:25
Rails debug cheat sheet

Setup

Replace IRB with Pry (in your Gemfile) and Byebug with pry-byebug.

gem 'pry-rails', group: [:development, :test]
gem 'pry-byebug', group: [:development, :test]

Using PRY

@rahul286
rahul286 / rbenv-ubuntu.sh
Created April 7, 2015 07:15
rbenv ubuntu server cheatsheet
## ubuntu server with bash shell
git clone https://github.com/sstephenson/rbenv.git ~/.rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bash_profile
echo 'eval "$(rbenv init -)"' >> ~/.bash_profile
git clone https://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
## verify
type rbenv