Skip to content

Instantly share code, notes, and snippets.

View Hecatoncheir's full-sized avatar
:octocat:
Focusing

Vitaliy Vostrikov Hecatoncheir

:octocat:
Focusing
View GitHub Profile
@kasperpeulen
kasperpeulen / README.md
Last active March 14, 2025 13:39
How to pretty-print JSON using Dart.
@Hecatoncheir
Hecatoncheir / vimrc
Last active October 21, 2016 14:44
My vimrc file
call plug#begin('~/.vim/plugged')
"--- neocompleter ---
"Plug 'Shougo/neocomplcache.vim'
"Plug 'Shougo/neocomplete.vim'
"Plug 'Shougo/neosnippet.vim'
"Plug 'Shougo/neosnippet-snippets'
Plug 'Valloric/YouCompleteMe'
@azenla
azenla / event_loop.dart
Last active December 19, 2024 22:01
Simulation of the Dart Event Loop in Dart.
/// Dart is built around a timer, which basically schedules functions in a queue.
/// The Future class is essentially just sugar on top of the event loop.
/// To help people understand what the event loop actually does, I have written code which implements the event loop.
/// See https://www.dartlang.org/articles/event-loop/ for more information.
import "dart:async";
class EventLoop {
/// Function Queue.
static final List<Function> queue = [];
@devoncarew
devoncarew / main.dart
Last active June 25, 2022 05:39
Fibonacci
// Copyright 2015 the Dart project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license
// that can be found in the LICENSE file.
void main() {
int i = 20;
print('fibonacci($i) = ${fibonacci(i)}');
}
/// Computes the nth Fibonacci number.
@akolosov
akolosov / gist:cedaac86b333a4ced95f
Last active February 5, 2025 05:47
vim 7.4 with lua+GUI on Ubuntu 14.04
#!/bin/sh
sudo apt-get remove --purge vim vim-runtime vim-gnome vim-tiny vim-common vim-gui-common
sudo apt-get install liblua5.1-dev luajit libluajit-5.1 python-dev ruby-dev libperl-dev mercurial libncurses5-dev libgnome2-dev libgnomeui-dev libgtk2.0-dev libatk1.0-dev libbonoboui2-dev libcairo2-dev libx11-dev libxpm-dev libxt-dev
sudo mkdir /usr/include/lua5.1/include
sudo ln -s /usr/include/luajit-2.0 /usr/include/lua5.1/include
cd ~
hg clone https://code.google.com/p/vim/
@fredriks
fredriks / gist:ac7f955a19ad49d8ee82
Last active December 16, 2018 02:43
Build vim 7.4 with lua support - Ubuntu 14.04 (Trusty)
# Remove previous installations
sudo apt-get remove vim vim-runtime vim-tiny vim-common
# Install dependencies
sudo apt-get install libncurses5-dev python-dev libperl-dev ruby-dev liblua5.2-dev
# Fix liblua paths
sudo ln -s /usr/include/lua5.2 /usr/include/lua
sudo ln -s /usr/lib/x86_64-linux-gnu/liblua5.2.so /usr/local/lib/liblua.so
@kui
kui / scrape.dart
Last active September 9, 2019 04:15
a web scraping script with Dart and html5lib
import 'dart:io';
import 'dart:async';
import 'package:html5lib/parser.dart';
import 'package:html5lib/dom.dart';
main() {
final url = 'http://comic-walker.com/';
getHtml(url).then((document) {
// page title
@brson
brson / gist:9dec4195a88066fa42e6
Last active January 12, 2025 18:31
A Rust Syntax Guide

A Guide to Rust Syntax

A very brief guide to Rust syntax. It assumes you are already familiar with programming concepts.

This was written in 2014. It is not a good reference for Rust today, though the content is still correct.

cheats.rs looks like a good alternative.

Assert macro

@booherbg
booherbg / gist:f812c9145d157d8945b2
Last active February 25, 2022 23:44
Cross compiling a simple go server for windows

How to build Golang windows/arm static binaries from linux

Alternate title: Cross compiling Windows/Darwin/Linux amd64/386/arm all from linux

After fumbling around trying to figure out the go toolchain and cross compilation configuration, I ran across the wiki page on Go's homepage. It's super helpful, and worked out of the box. I'm including the necessary scripts here in case they get changed or lost, and we can help Google find it (since it's the first real source I've found that "Just Worked"). http://code.google.com/p/go-wiki/wiki/WindowsCrossCompiling

anonymous
anonymous / Bubble-y-Text-Fader.markdown
Created May 28, 2014 11:12
A Pen by Anonasaurus Rex.