Skip to content

Instantly share code, notes, and snippets.

View xentatt's full-sized avatar
💨

Dmytro Uhnichenko xentatt

💨
  • Ukraine, Kyiv
  • 00:18 (UTC +03:00)
View GitHub Profile
@xentatt
xentatt / nerd_fonts.sh
Created February 22, 2023 21:52 — forked from davidteren/nerd_fonts.md
Install Nerd Fonts via Homebrew [updated & fixed]
# Nerd Fonts for your IDE
# https://www.nerdfonts.com/font-downloads
brew tap homebrew/cask-fonts && brew install --cask font-3270-nerd-font
brew tap homebrew/cask-fonts && brew install --cask font-fira-mono-nerd-font
brew tap homebrew/cask-fonts && brew install --cask font-inconsolata-go-nerd-font
brew tap homebrew/cask-fonts && brew install --cask font-inconsolata-lgc-nerd-font
brew tap homebrew/cask-fonts && brew install --cask font-inconsolata-nerd-font
brew tap homebrew/cask-fonts && brew install --cask font-monofur-nerd-font
brew tap homebrew/cask-fonts && brew install --cask font-overpass-nerd-font
@xentatt
xentatt / gist:f561522146b7aab48826
Created August 25, 2014 14:04
NodeJS + MongoDB
var MongoClient = require('mongodb').MongoClient;
MongoClient.connect('mongodb://localhost:27017/weather', function(err, db) {
if(err) throw err;
var map = function() {
emit(this["State"], 1);
}
@xentatt
xentatt / gist:5618922
Created May 21, 2013 10:44
Infinite generator
#!/usr/bin/env ruby
# Return given number of even Integers
# that have number '4' within them
even_numbers = Enumerator.new do |yielder|
number = 0
count = 1
loop do
number += count
count += 1
#!/usr/bin/env ruby
def multifunc(msg, pos, b)
puts "Calculating: #{msg}"
b.call(pos)
end
puts multifunc("Fibonacci numb", 5, f = lambda { |n| (n == 0 || n == 1) ? n : (f.call(n-1) + f.call(n-2)) })
@xentatt
xentatt / GoodBye cruel world
Last active December 13, 2015 18:38
Remove last searched word
var data = "hello cruel super cruel world is cruel here alas"
data_result = data.substring(0, data.lastIndexOf("cruel")) + data.substring(data.lastIndexOf("cruel") + "cruel".length, data.length)
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="sample.css">
<title>Sample file to test CSS</title>
</head>
<body>
<div class="main">
<h1 class="center">This is CSS test file.</h1>
<div class="center brd background">