Skip to content

Instantly share code, notes, and snippets.

@rofrol
rofrol / Gitd
Last active August 29, 2015 14:16
#!/bin/sh
#
# Startup/shutdown script for Git Daemon
# chkconfig: 345 56 10
#
# description: Startup/shutdown script for Git Daemon
#
. /etc/init.d/functions
DAEMON=/usr/libexec/git-core/git-daemon
@rofrol
rofrol / index.html
Last active September 19, 2015 18:36 — forked from anonymous/index.html
JS Bin // source https://jsbin.com/yelaqa
<!DOCTYPE html>
<html>
<head>
<script src="http://fb.me/react-with-addons-0.13.3.js"></script>
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body>
<h1>getTopRatedFilms()</h1>
<button onClick="getMovies()">getMovies</button>
@rofrol
rofrol / data-markdown.user.js
Last active January 28, 2016 14:29 — forked from paulirish/data-markdown.user.js
*[data-markdown] - use markdown, sometimes, in your HTML
// ==UserScript==
// @name Use Markdown, sometimes, in your HTML.
// @author Paul Irish <http://paulirish.com/>
// @link http://git.io/data-markdown
// @match *
// ==/UserScript==
// If you're not using this as a userscript just delete from this line up. It's cool, homey.
@rofrol
rofrol / Cargo.toml
Last active August 19, 2016 11:47 — forked from gkbrk/Cargo.toml
Asynchronous server example in Rust
[package]
name = "rust-async-qotd"
version = "0.1.0"
authors = ["Gökberk Yaltıraklı <[email protected]>"]
[dependencies]
tokio = { git = "https://github.com/tokio-rs/tokio" }
rand = "0.3"
[[bin]]
@rofrol
rofrol / .psqlrc
Created August 17, 2017 09:52 — forked from tkalfigo/.psqlrc
My .psqlrc
\set QUIET 1
\pset null '(null)'
\pset linestyle unicode
\pset border 2
\timing
\set ON_ERROR_ROLLBACK interactive
\set HISTFILE ~/.psql_history- :HOST - :DBNAME
\set HISTSIZE 2000
\set PROMPT1 '%n@%/[%M:%>] # '
\set PROMPT2 '> '
@rofrol
rofrol / .psqlrc
Created August 17, 2017 09:52 — forked from tkalfigo/.psqlrc
My .psqlrc
\set QUIET 1
\pset null '(null)'
\pset linestyle unicode
\pset border 2
\timing
\set ON_ERROR_ROLLBACK interactive
\set HISTFILE ~/.psql_history- :HOST - :DBNAME
\set HISTSIZE 2000
\set PROMPT1 '%n@%/[%M:%>] # '
\set PROMPT2 '> '
(function() {
/* This function forces rustdoc to collapse documentation for all items,
except for the methods defined in an impl block and the primary type's
declaration. This is the most natural view IMO, since it provides the
primary type along with an easy to scan overview of available methods.
rustdoc does seemingly have user settings that purport to make this the
default, but I could never cause them to work in a reliably consistent
way. This is especially useful when writing documents, where you commonly
want to refresh and look at the docs for the specific item you're working
@rofrol
rofrol / dns-sync.sh
Last active August 31, 2020 08:15 — forked from matthiassb/dns-sync.sh
Init.d script for keeping WSL resolv.conf in-sync with Windows
#! /bin/bash
### BEGIN INIT INFO
# Provides: dns-sync
# Required-Start:
# Required-Stop:
# Default-Start: S
# Default-Stop:
# Short-Description: Synchronizes /etc/resolv.conf in WLS with Windows DNS - Matthias Brooks
### END INIT INFO
@rofrol
rofrol / script-calculator.js
Created September 10, 2021 20:55 — forked from tchayen/script-calculator.js
Javascript calculator using Reverse Polish notation and Shunting-yard algorithm
// function connecting algorithm with outer world
function updateCalculator(event) {
var expression = document.getElementById("calculator").value;
var result = calculate(expression);
document.getElementById('calculatorResult').innerHTML = result;
}
function calculate(expression) {
@rofrol
rofrol / README.md
Created October 25, 2021 21:58 — forked from fvclaus/README.md
Run vscode tasks with nvm

Nvm does not work in vscode tasks, because tasks are run without a shell. .bashrc is not loaded and the nvm command is unknown.

My solution uses a wrapper script around /bin/bash that reads in the correct node version from .npmrc in the project folder.

#!/bin/bash

set -e

if [[ "$2" == nvm* ]]; then

export NODE_VERSION=v$(cat .nvmrc)