Skip to content

Instantly share code, notes, and snippets.

View Jeff-Tian's full-sized avatar
:octocat:
欢迎关注我的公众号: 哈德韦 。

Jeff Tian Jeff-Tian

:octocat:
欢迎关注我的公众号: 哈德韦 。
View GitHub Profile
@nightire
nightire / 解决 Git 在 windows 下中文乱码的问题.md
Last active April 24, 2024 16:19
解决 Git 在 windows 下中文乱码的问题

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

原因

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

解决方案

  1. 安装
@pbrisbin
pbrisbin / install.md
Last active August 25, 2021 14:06
Installing OpenCart on Heroku

Installation

This gets OpenCart running enough that we can use the GUI Installer

  1. Create Heroku project with ClearDB MySQL add-on
  2. Download OpenCart sources
  3. Move ./upload/* to top-level (those are the PHP site files)
  4. Copy zlib.so into ./ext/zlib.so
  5. Write extension = /app/www/ext/zlib.so into php.ini
  6. Push
@zaus
zaus / ConfigurableJsMinify.cs
Last active January 10, 2020 02:16
How to create a custom BundleTransform in .NET MVC4, specifically for the purposes of not renaming variables. Since I could not find this after an hour of concentrated interweb searching...
using System.IO;
using Microsoft.Ajax.Utilities;
/// <summary>
/// Minify javascript files with externally overridable configuration settings.
/// </summary>
public class ConfigurableJsMinify : StandardFileBundleTransform {
protected bool includeFilenamesInOutput;
@katychuang
katychuang / remove_brew-mongo_osx.sh
Last active January 30, 2024 12:20
remove mongodb that was installed via brew
#!/usr/bin/env sh
# first check to see if mongo service is running. you can't delete any files until the service stops so perform a quick check.
launchctl list | grep mongo
# NOTE: the pipe | symbol means the commands on the right performs on the output from the left
# grep is a string search utility. `grep mongo` means search for the substring mongo
# use the unload command to end the mongo service. this is required to 'unlock' before removing the service.
# first look for the file to delete
MONGO_SERVICE_FILE=$(ls ~/Library/LaunchAgents/*mongodb*)
@patrickhammond
patrickhammond / android_instructions.md
Last active March 29, 2024 20:14
Easily setup an Android development environment on a Mac

Here is a high level overview for what you need to do to get most of an Android environment setup and maintained.

Prerequisites (for Homebrew at a minimum, lots of other tools need these too):

  • XCode is installed (via the App Store)
  • XCode command line tools are installed (xcode-select --install will prompt up a dialog)
  • Java

Install Homebrew:

ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"

@tomgp
tomgp / package.json
Last active February 16, 2024 22:08
Server side SVG via D3 & jsdom
{
"name": "simple-node-d3",
"version": "1.0.0",
"description": "Serverside SVG via D3 & jsdom",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "tom.g.pearson@gmail.com",
"license": "ISC",

Aligning images

This is a guide for aligning images.

See the full Advanced Markdown doc for more tips and tricks

left alignment

@arthurattwell
arthurattwell / electric-book-tools-setup-osx.md
Last active September 16, 2023 04:20
Setting up the Electric Book toolset on OSX

Setting up the EBW tools on Mac OSX

These steps have worked for us on several machines. Every machine is a bit different, so your mileage may vary.

https://jekyllrb.com/docs/installation/macos/

On Windows? I've written up guidance for installing on Windows here.

  1. Install Homebrew (without XCode -- you do not need to install XCode!). This is done in two steps from the Terminal. See ryanwinchester.ca/posts/installing-homebrew-without-xcode. Essentially:
    1. Install XCode developer tools (lets Homebrew work):
@gobinathm
gobinathm / shallow_update_git.md
Created March 6, 2017 18:24
Fix for Remote rejected shallow update not allowed after changing Git remote URL

Some Time there is a shallow update not allowed issue in your cloned GIT repo.

This means that you have to unshallow your repository. To do so you will need to add your old remote again.

git remote add origin <path-to-old-remote> After that we use git fetch to fetch the remaining history from the old remote (as suggested in this answer).

git fetch --unshallow origin And now you should be able to push into your new remote repository.

@reline
reline / CustomTrust.java
Last active August 24, 2022 12:45
Trusting self-signed certificates in Android using OkHttp
import okhttp3.*;
import okio.Buffer;
import javax.net.ssl.*;
import java.io.IOException;
import java.io.InputStream;
import java.security.GeneralSecurityException;
import java.security.KeyStore;
import java.security.cert.Certificate;
import java.security.cert.CertificateFactory;