Skip to content

Instantly share code, notes, and snippets.

View fand's full-sized avatar
💭
🔪

AMAGI / Jun Yuri fand

💭
🔪
View GitHub Profile
@paraya3636
paraya3636 / KotlinAndroidMainApplication
Last active October 7, 2023 23:07
Kotlin Android MainApplication class for global applicationContext.
// Not object class. AndroidManifest.xml error happen.
class MainApplication : Application() {
init {
instance = this
}
companion object {
private var instance: MainApplication? = null
@kosamari
kosamari / _ServiceWorker_for_github_pages.md
Last active April 1, 2024 05:44
ServiceWorker for github pages.

ServiceWorker for github pages

This is a ServiceWorker template to turn small github pages into offline ready app.

Why ?

Whenever I make small tools & toys, I create github repo and make a demo page using github pages (like this one).
Often these "apps" are just an index.html file with all the nessesary CSS and JavaScript in it (or maybe 2-3 html/css/js files). I wanted to cache these files so that I can access my tools offline as well.

Notes

Make sure your github pages have HTTPS enforced, you can check Settings > GitHub Pages > Enforce HTTPS of your repository.

@shuhei
shuhei / couple.rb
Created May 9, 2016 16:23
愛を生む二人を探して
# Extract meaningful bits.
# https://en.wikipedia.org/wiki/UTF-8#Description
def code_bits(bits)
bits.each_slice(8).with_index.map do |byte, i|
i == 0 ? byte[4..-1] : byte[2..-1]
end.flatten
end
# Returns unicode charactor from bits.
def bits_to_char(bits)
@sugi-cho
sugi-cho / UnlitCastShadow.shader
Last active March 29, 2021 01:17
ShadowCastの使い方
Shader "Unlit/UnlitCastShadow"
{
Properties
{
_MainTex("Texture", 2D) = "white" {}
}
CGINCLUDE
#include "UnityCG.cginc"
struct appdata
@kwilczynski
kwilczynski / Makefile
Last active March 8, 2024 23:48
Makefile for my Go projects (an example).
SHELL := /bin/bash
REV := $(shell git rev-parse HEAD)
CHANGES := $(shell test -n "$$(git status --porcelain)" && echo '+CHANGES' || true)
TARGET := packer-provisioner-itamae-local
VERSION := $(shell cat VERSION)
OS := darwin freebsd linux openbsd
ARCH := 386 amd64
@rauchg
rauchg / README.md
Last active January 6, 2024 07:19
require-from-twitter
@d-akara
d-akara / JavaScriptSafeNavigation.md
Last active April 11, 2024 16:18
JavaScript Safe Navigation

Experimental Safe JavaScript Navigation

Implemented using ES6 Proxies and Symbols

The purpose of this function is to provide a way to avoid deep nested conditionals when traversing a hierarchy of objects. Some languages use an operator such as '?.' to perform this capability. This is sometimes called safe navigation or null conditional operators.

You can somewhat think of this as how a xpath select works. If any nodes along the path are not found, your result is simply not found without throwing an exception and without needing to check each individual node to see if it exists.

Suggestions for improvements welcome!

@mrodalgaard
mrodalgaard / atomTestRunner.coffee
Last active July 21, 2017 09:42
Atom custom test runner with Mocha and Coverage
fs = require 'fs'
path = require 'path'
Mocha = require 'mocha'
coffeeCoverage = require 'coffee-coverage'
{allowUnsafeEval, allowUnsafeNewFunction} = require 'loophole'
module.exports = (args) ->
@ahomu
ahomu / .babelrc
Last active October 14, 2019 14:50
browserify(&watchify) で tsify --target=es6 と babelify を併用する
{
"modules": "commonStrict",
"sourceMaps": "inline",
"loose": true,
"blacklist": [
]
}
@mitsuruog
mitsuruog / index.md
Last active April 15, 2024 00:54
express実践入門

express実践入門


自己紹介

小川充

  • mitsuruog