Skip to content

Instantly share code, notes, and snippets.

View amekusa's full-sized avatar
🏠
Working from home

amekusa amekusa

🏠
Working from home
View GitHub Profile
@amekusa
amekusa / Generic.gitignore
Last active August 29, 2015 14:13
.gitignore for generic use
# Dot Files / Folders
.*
.*/
!.git*
!.hg*
!.htaccess
# Crap Files
Thumbs.db
@amekusa
amekusa / WordPress.gitignore
Created January 22, 2015 10:44
.gitignore for WordPress
wp-content/*
!wp-content/plugins/
!wp-content/themes/
!wp-content/languages/
wp-config.php
sitemap.xml
sitemap.xml.*
@amekusa
amekusa / Generic.gitattributes
Created January 22, 2015 10:46
.gitattributes for generic use
# Detects text files and normalises line breaks
* text=auto eol=lf

Make a directory sharable

chmod g+s $(find /path/to/dir -type d)
chgrp -R mygroup /path/to/dir

Add an user to a group

/**
* Sticky Header
* @author amekusa <[email protected]>
*/
jQuery(document).ready(function ($) {
var $header = $("#header");
$header.css("position", "relative");
$(window).on("scroll", function () {
$header.css("top", $(this).scrollTop());
@amekusa
amekusa / README.md
Last active August 29, 2015 14:20
OS X Commandline Utilities

OS X Commandline Utilities

Commands

app [Application Name]

Launches the application.

finder_shows_all

Select whether Finder shows hidden files and directories.

@amekusa
amekusa / Random TIPs.md
Last active January 20, 2016 09:22
Random TIPs

Random TIPs

OS X

How to get rid of firewall “accept incoming connections” dialog

sudo codesign --force --deep --sign - /path/to/application.app

“{Application Name} was unable to find a valid jvm”

@amekusa
amekusa / WordPress Troubleshooting.md
Last active December 3, 2015 00:55
WordPress Troubleshooting

WordPress Troubleshooting

Why is my post meta changes saved when I clicked "Preview Changes"

Use update_metadata() instead of update_post_meta().

How to remove leading /blog/ on permalink

  1. Settings -> Permalinks -> Common Setting -> Default
  2. Admin -> Sites -> (root site) Permalink Sturcture -> /%category%/%post_id%/
@amekusa
amekusa / bresenham3d
Created November 13, 2015 03:45 — forked from yamamushi/bresenham3d
C++ Bresenham 3d Line Drawing Algorithm
// Bresenham3D
//
// A slightly modified version of the source found at
// http://www.ict.griffith.edu.au/anthony/info/graphics/bresenham.procs
// Provided by Anthony Thyssen, though he does not take credit for the original implementation
//
// It is highly likely that the original Author was Bob Pendelton, as referenced here
//
// ftp://ftp.isc.org/pub/usenet/comp.sources.unix/volume26/line3d
//
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\HID\{Your Device ID}\Device Parameters]
"FlipFlopHScroll"=dword:00000001
"FlipFlopWheel"=dword:00000001