Skip to content

Instantly share code, notes, and snippets.

View amaraa87's full-sized avatar

Amarsanaa amaraa87

View GitHub Profile
@nicolaskopp
nicolaskopp / ios-fixed-scrolling-fix.css
Last active March 19, 2025 03:55
Fix scrolling bug on iOS Safari with fixed elements and bottom bar
/* Fix scrolling bug on iOS Safari with fixed elements and bottom bar */
body.noscroll {
height: 100%;
overflow: hidden; /* make sure iOS does not try to scroll the body first */
}
/* your wrapper, most likely mobile menu */
.fixed-wrapper {
width: 100%;
@callumlocke
callumlocke / .zshrc
Last active April 8, 2025 04:21
ZSH function to auto-switch to correct Node version
####
# ZSH function to auto-switch to correct Node version
# https://gist.github.com/callumlocke/30990e247e52ab6ac1aa98e5f0e5bbf5
#
# - Searches up your directory tree for the closest .nvmrc, just like `nvm use` does.
#
# - If you are already on the right Node version, IT DOES NOTHING, AND PRINTS NOTHING.
#
# - Works correctly if your .nvmrc file contains something relaxed/generic,
# like "4" or "v12.0" or "stable".
@lenkan
lenkan / use-location.js
Created March 2, 2019 18:26
React hook that keeps up to date with the current location.
// @ts-check
import { useState, useEffect } from 'react'
function getCurrentLocation () {
return {
pathname: window.location.pathname,
search: window.location.search
}
}
@ganzo
ganzo / mn_aimag_hot_duureg_horoo.sql
Created May 4, 2017 01:04 — forked from anonymous/mn_aimag_hot_duureg_horoo.sql
Монгол улсын хот, аймаг, дүүрэг, хороодын мэдээллийн бааз. By Анхаа Анхбаяр
-- MySQL Administrator dump 1.4
--
-- ------------------------------------------------------
-- Server version 5.5.16
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
@QWp6t
QWp6t / wc-checkout-fields-optgroup.php
Created June 30, 2016 00:51
Add optgroup support to WooCommerce select form fields
<?php
/**
* Plugin Name: Add optgroup support to WooCommerce select form fields
* Description: Converts <code>Group: Option</code> syntax in WooCommerce select form fields into <code>&lt;optgroup...&gt;&lt;option...&gt;</code>
* Author: QWp6t
* Author URI: https://qwp6t.me/
*/
/** NOTE: This shit was quickly hacked together. Worked for me. YMMV. */
anonymous
anonymous / mn_aimag_hot_duureg_horoo.sql
Created January 20, 2014 07:23
Монгол улсын хот, аймаг, дүүрэг, хороодын мэдээллийн бааз. By Анхаа Анхбаяр
-- MySQL Administrator dump 1.4
--
-- ------------------------------------------------------
-- Server version 5.5.16
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
@pitch-gist
pitch-gist / gist:2999707
Created June 26, 2012 22:21
HTML: Simple Maintenance Page
<!doctype html>
<title>Site Maintenance</title>
<style>
body { text-align: center; padding: 150px; }
h1 { font-size: 50px; }
body { font: 20px Helvetica, sans-serif; color: #333; }
article { display: block; text-align: left; width: 650px; margin: 0 auto; }
a { color: #dc8100; text-decoration: none; }
a:hover { color: #333; text-decoration: none; }
</style>
@bueltge
bueltge / post-process.php
Created June 24, 2011 21:08
WordPress Custom Post Type: Insert post via Frontend
<?php
/**
* post-process.php
* make sure to include post-process.php in your functions.php. Use this in functions.php:
*
* get_template_part('post-process');
*
*/
function do_insert() {
if( 'POST' == $_SERVER['REQUEST_METHOD']