Skip to content

Instantly share code, notes, and snippets.

View .zshrc
function peco-docker-compose () {
local selected_dir=$(ghq list --full-path | while read repo; do [ -f "${repo}/docker-compose.yml" ] && echo "$repo"; done | peco --query "$LBUFFER")
if [ -n "$selected_dir" ]; then
docker-compose --file "${selected_dir}/docker-compose.yml" --project-name "$(basename $selected_dir)" $*
fi
}
@akrabat
akrabat / CorsMiddlewareFactory.php
Created Oct 21, 2017
Expressive factory to use CORS middleware
View CorsMiddlewareFactory.php
<?php declare(strict_types=1);
namespace App\Factory;
use Psr\Http\Message\RequestInterface;
use Psr\Http\Message\ResponseInterface;
use Tuupola\Middleware\Cors;
use Zend\Diactoros\Response;
use Zend\Diactoros\Response\JsonResponse;
use Zend\ProblemDetails\ProblemDetailsResponseFactory;
use Zend\Stratigility\Middleware\CallableMiddlewareWrapper;
View aosp.xml
<?xml version="1.0" encoding="UTF-8"?>
<manifest>
<!-- LineageOS Dependency Projects -->
<project name="LineageOS/android_packages_resources_devicesettings" path="packages/resources/devicesettings" remote="github" revision="lineage-16.0" />
<project name="LineageOS/android_external_bson" path="external/bson" remote="github" revision="lineage-16.0" />
<project name="LineageOS/android_system_qcom" path="system/qcom" remote="github" revision="lineage-16.0" />
<!-- Motorola Projects -->
<project name="W-OS/android_device_motorola_payton" path="device/motorola/payton" remote="github" revision="aosp" />
@parmentf
parmentf / GitCommitEmoji.md
Last active Jun 20, 2019
Git Commit message Emoji
View GitCommitEmoji.md
@nightire
nightire / 解决 Git 在 windows 下中文乱码的问题.md
Last active Jun 20, 2019
解决 Git 在 windows 下中文乱码的问题
View 解决 Git 在 windows 下中文乱码的问题.md

解决 Git 在 windows 下中文乱码的问题

原因

中文乱码的根源在于 windows 基于一些历史原因无法全面支持 utf-8 编码格式,并且也无法通过有效手段令其全面支持。

解决方案

  1. 安装
@jdormit
jdormit / retry.sh
Last active Jun 20, 2019
Bash script to retry a failed command
View retry.sh
#!/bin/bash
# Retries a command on failure.
HELP=\
"$0: $0 [flags] [options] [--] COMMAND
Runs a command, retrying if the command fails
Arguments:
COMMAND The command to run
@trestletech
trestletech / server.R
Last active Jun 20, 2019
A Shiny app combining the use of dplyr and SQLite. The goal is to demonstrate a full-fledged, database-backed user authorization framework in Shiny.
View server.R
library(shiny)
library(dplyr)
library(lubridate)
# Load libraries and functions needed to create SQLite databases.
library(RSQLite)
library(RSQLite.extfuns)
saveSQLite <- function(data, name){
path <- dplyr:::db_location(filename=paste0(name, ".sqlite"))
View rails_migration_cheatsheet.md
@KDercksen
KDercksen / unet.py
Created Mar 11, 2018
U-Net original architecture implementation for Keras
View unet.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from keras.layers import (concatenate,
Conv2D,
Cropping2D,
Input,
MaxPooling2D,
UpSampling2D,
)
@LeCoupa
LeCoupa / nodejs-cheatsheet.js
Last active Jun 20, 2019
Complete Node.js CheatSheet --> UPDATED VERSION --> https://github.com/LeCoupa/awesome-cheatsheets
View nodejs-cheatsheet.js
/* *******************************************************************************************
* THE UPDATED VERSION IS AVAILABLE AT
* https://github.com/LeCoupa/awesome-cheatsheets
* ******************************************************************************************* */
// 0. Synopsis.
// http://nodejs.org/api/synopsis.html
You can’t perform that action at this time.