This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import subprocess | |
import json | |
def workspace_prev(): | |
subprocess.run(["i3-msg", "workspace", "prev"]) | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
machine: | |
environment: | |
CRYSTAL_VERSION: "0.20.1" # Replace version to which you're using | |
PATH: "${PATH}:${HOME}/.crystal/bin" | |
CRYSTAL_URL: "https://github.com/crystal-lang/crystal/releases/download/${CRYSTAL_VERSION}/crystal-${CRYSTAL_VERSION}-1-linux-x86_64.tar.gz" | |
dependencies: | |
cache_directories: | |
- ~/.crystal | |
- lib | |
- .shards |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import DBus from 'dbus' | |
import Promise from 'bluebird' | |
const dbus = new DBus() | |
const bus = dbus.getBus('system') | |
const NM_SERVICE = 'org.freedesktop.NetworkManager' | |
const NM_OBJECT = '/org/freedesktop/NetworkManager' | |
const NM_INTERFACE = NM_SERVICE |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as jasmineImmutable from 'jasmine-immutable-matchers' | |
import mapValues from 'lodash/mapValues' | |
const jestImmutable = mapValues(jasmineImmutable, (matcherFactory) => { | |
const matcher = matcherFactory() | |
return function () { | |
const { isNot } = this | |
const { pass, message } = matcher[isNot ? 'negativeCompare' : 'compare'](...arguments) | |
return { | |
pass: Boolean(pass), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Usage: bash command-not-found.sh <command> | |
# Eample: bash command-not-found.sh ls | |
# Then if you type ls it will act like ls is not install. | |
if [[ -z $1 ]]; then | |
return | |
fi | |
current_shell="$(rev <<< "$SHELL" | cut -d '/' -f 1 | rev)" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def convert(input_x, input_y) | |
dx = 250000 | |
dy = 0 | |
k0 = 0.9999 | |
a = 6378137.0 | |
b = 6356752.314245 | |
e = (1 - b ** 2 / a ** 2) ** 0.5 | |
lon0 = 121 * Math::PI / 180 | |
x = input_x.to_f - dx | |
y = input_y.to_f - dy |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef SIGNAL_HPP_INCLUDE | |
#define SIGNAL_HPP_INCLUDE | |
#include <functional> | |
template<typename Signature> | |
class Signal { | |
public: | |
typedef typename std::function<Signature> Function; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if exists("b:did_indent") | |
finish | |
endif | |
let b:did_indent = 1 | |
setlocal indentexpr=GetNasmIndent(v:lnum) | |
setlocal indentkeys+=<:> | |
if exists("*GetNasmIndent") | |
finish |