Skip to content

Instantly share code, notes, and snippets.

View andy0130tw's full-sized avatar
🍌
why no 🍆

Andy Pan andy0130tw

🍌
why no 🍆
View GitHub Profile
@joepie91
joepie91 / .md
Last active June 10, 2024 14:18
Running a Node.js application using nvm as a systemd service

Read this first!

Hi there! Since this post was originally written, nvm has gained some new tools, and some people have suggested alternative (and potentially better) approaches for modern systems. Make sure to have a look at the comments to this article, before following this guide!


The original article

Trickier than it seems.

/**=======佈景發佈 by疾患=======**/
/*作者噗浪 http://www.plurk.com/hoshikata*/
/*
請直接在自訂佈景把所有的語法貼上,而且必須先選擇新版的預設佈景,
背景圖片當然自己放即可。
此佈景適合搭配的背景是偏灰色單調背景。
*/
/**隱藏廣告**/
#resp_banner_ads.show {height: 0px; overflow: hidden;}
@vancluever
vancluever / gnome-tracker-disable.md
Last active May 2, 2024 16:26
GNOME Tracker Disable

Disabling GNOME Tracker and Other Info

GNOME's tracker is a CPU and privacy hog. There's a pretty good case as to why it's neither useful nor necessary here: http://lduros.net/posts/tracker-sucks-thanks-tracker/

After discovering it chowing 2 cores, I decided to go about disabling it.

Directories

@Francesco149
Francesco149 / shige-skins.md
Last active March 31, 2024 14:53
Shigetora / Cookiezi skin compilation
@paulirish
paulirish / what-forces-layout.md
Last active June 13, 2024 11:17
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
<?
/////////////////////
// slack2html
// by @levelsio
/////////////////////
//
/////////////////////
// WHAT DOES THIS DO?
/////////////////////
//
@jankais3r
jankais3r / Ghost_custom_excerpt_tag.md
Created July 29, 2015 21:49
Ghost - custom excerpt tag

This code snippet implements manual control over excerpts in Ghost.

You will need to modify 2 files and 1 setting:

  1. Ghost/core/server/helpers/content.js - this one will get overwritten during Ghost update
  2. Ghost/content/themes//partials/loop.hbs - this one has to be modified for each theme
  3. 'Blog Footer' section of 'Code Injection' settings page

Default behavior is having whole articles displayed on the front page. If you want to display only an excerpt, put `` at the position you want to cut the article.

@karpathy
karpathy / min-char-rnn.py
Last active June 11, 2024 01:44
Minimal character-level language model with a Vanilla Recurrent Neural Network, in Python/numpy
"""
Minimal character-level Vanilla RNN model. Written by Andrej Karpathy (@karpathy)
BSD License
"""
import numpy as np
# data I/O
data = open('input.txt', 'r').read() # should be simple plain text file
chars = list(set(data))
data_size, vocab_size = len(data), len(chars)
@skeeto
skeeto / Makefile
Created October 21, 2014 03:51
C Object Oriented Programming Example
CFLAGS = -std=c99 -Wall
main : main.o
.PHONY : test clean
test : main
./$^ "*regex*" "*vtable*" < main.c
clean :
@pburtchaell
pburtchaell / styles.css
Last active February 25, 2024 12:24
VH and VW units can cause issues on iOS devices. To overcome this, create media queries that target the width, height, and orientation of iOS devices.
/**
* VH and VW units can cause issues on iOS devices: http://caniuse.com/#feat=viewport-units
*
* To overcome this, create media queries that target the width, height, and orientation of iOS devices.
* It isn't optimal, but there is really no other way to solve the problem. In this example, I am fixing
* the height of element `.foo` —which is a full width and height cover image.
*
* iOS Resolution Quick Reference: http://www.iosres.com/
*/