Skip to content

Instantly share code, notes, and snippets.

@jadestrong
jadestrong / Dockerfile
Created January 28, 2025 03:42 — forked from c4droid369/Dockerfile
Building Emacs feature/igc branch in Docker
# Setup basic build environment
FROM alpine:latest AS base
RUN sed -i 's#https\?://dl-cdn.alpinelinux.org/alpine#https://mirrors.tuna.tsinghua.edu.cn/alpine#g' /etc/apk/repositories
RUN apk update && apk upgrade
RUN apk add \
alpine-sdk autoconf automake \
gnutls-dev ncurses-dev libxml2-dev libxpm-dev tiff-dev giflib-dev \
(use-package flycheck
:ensure t
:config
(add-hook 'typescript-mode-hook 'flycheck-mode))
(defun setup-tide-mode ()
(interactive)
(tide-setup)
(flycheck-mode +1)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<style>
.flex-container {
background-color: blanchedalmond;
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Font
:set guifont=Source\ Code\ Pro:h14
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Hide pointless junk at the bottom, doesn't work in .vimrc for some reason?
:set laststatus=0
:set noshowmode "don't show --INSERT--
:set noruler "don't show line numbers/column/% junk
@jadestrong
jadestrong / rtags + OS X.md
Created December 6, 2018 02:13 — forked from floatplane/rtags + OS X.md
rtags OS X
  1. brew install llvm --with-libcxx --with-clang --without-assertions --with-rtti
  2. git clone git@github.com:Andersbakken/rtags.git; cd rtags; git submodule init; git submodule update
  3. make a build directory, run cmake from it:

brian@brian-desktop.local: /Users/brian/src/rtags/build [master] $ LLVM_CONFIG=/usr/local/opt/llvm/bin/llvm-config CMAKE_PREFIX_PATH=/usr/local/opt/llvm CC=/usr/local/opt/llvm/bin/clang CXX=/usr/local/opt/llvm/bin/clang++ cmake .. ```

  1. make && make install
  2. set up launchd integration: https://github.com/Andersbakken/rtags#integration-with-launchd-mac-os-x
  3. generate compile_commands.json: xctool -reporter json-compilation-database:compile_commands.json -workspace iOS/Paper/Paper.xcworkspace -scheme Paper -configuration Debug -derivedDataPath .build
@jadestrong
jadestrong / init.el
Created February 22, 2018 11:23 — forked from masutaka/init.el
~/.emacs.d/init.el
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; For isolation environment
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(if load-file-name
(setq user-emacs-directory (file-name-directory load-file-name)))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; Constants
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@jadestrong
jadestrong / main.js
Created January 25, 2018 11:22
Vue.js Filter: Percentage
Vue.filter("percentage", function(value, decimals) {
if(!value) value = 0;
if(!decimals) decimals = 0;
value = value * 100;
return Math.round(value * Math.pow(10, decimals)) / Math.pow(10, decimals) + "%";
});
@jadestrong
jadestrong / utf8-regex.js
Created November 29, 2017 03:41 — forked from chrisveness/utf8-regex.js
Utf8 string encode/decode using regular expressions
/**
* Encodes multi-byte Unicode string into utf-8 multiple single-byte characters
* (BMP / basic multilingual plane only).
*
* Chars in range U+0080 - U+07FF are encoded in 2 chars, U+0800 - U+FFFF in 3 chars.
*
* Can be achieved in JavaScript by unescape(encodeURIComponent(str)),
* but this approach may be useful in other languages.
*
* @param {string} unicodeString - Unicode string to be encoded as UTF-8.
@jadestrong
jadestrong / jQuery.stringify.js
Created April 17, 2016 12:26 — forked from chicagoworks/jQuery.stringify.js
jQuery.stringify() utility
/**
* converted stringify() to jQuery plugin.
* serializes a simple object to a JSON formatted string.
* Note: stringify() is different from jQuery.serialize() which URLEncodes form elements
* UPDATES:
* Added a fix to skip over Object.prototype members added by the prototype.js library
* USAGE:
* jQuery.ajax({