This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
include("kana.php"); | |
if(isset($_GET['in']) && isset($_GET['action'])) | |
{ | |
$in = $_GET['in']; | |
if($_GET['action'] == "to_hira") | |
{ | |
$out = Kana::to_hiragana($in); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public extension UIColor { | |
/// Create color from RGB(A) | |
/// | |
/// Parameters: | |
/// - absoluteRed: Red value (between 0 - 255) | |
/// - green: Green value (between 0 - 255) | |
/// - blue: Blue value (between 0 - 255) | |
/// - alpha: Blue value (between 0 - 255) | |
/// |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let myDictionary = [ | |
"20" : "banna", | |
"60" : "apple", | |
"30" : "cucumber", | |
"10" : "starfruit" | |
] | |
//assume that sort() kinda takes 2 arguments i.e. sort(dictionary element a, dictionary element b) | |
//woriking its way down the array (http://www.sorting-algorithms.com/bubble-sort) | |
//compare the 0th assumed parameter(a) with the 1st assumed parameter (b), using the key (0 after decimal) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import CoreGraphics | |
import SpriteKit | |
extension SKAction { | |
static func transitionStrokeColor(from: SKColor, to: SKColor, duration: TimeInterval) -> SKAction { | |
return transitionColor(from: from, to: to, duration: duration, fill: false) | |
} | |
static func transitionFillColor(from: SKColor, to: SKColor, duration: TimeInterval) -> SKAction { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* From https://isabelcastillo.com/woocommerce-check-shipping-class | |
* Check if the cart has product with a certain Shipping Class | |
* @param string $slug the shipping class slug to check for | |
* @return bool true if a product with the Shipping Class is found in cart | |
*/ | |
function cart_has_product_with_shipping_class( $slug ) { | |
global $woocommerce; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Each of these samples can be used - note that you should pick one rather than add them all. | |
* | |
* How to use WC notices: https://github.com/woothemes/woocommerce/blob/master/includes/wc-notice-functions.php#L96 | |
* Tutorial: http://www.skyverge.com/blog/edit-woocommerce-templates/ | |
**/ | |
/** | |
* Add a content block after all notices, such as the login and coupon notices. | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// taken 2018-03-19 from wikipedia. https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes | |
public enum Iso639_1: String { | |
case ab = "AB" | |
case aa = "AA" | |
case af = "AF" | |
case ak = "AK" | |
case sq = "SQ" | |
case am = "AM" | |
case ar = "AR" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Japanese Language Stack Exchange Hacks | |
// @namespace stackexchange | |
// @description Furigana, pitch accent and Japanese font-related script for the Japanese Language Stack Exchange (http://japanese.stackexchange.com) | |
// @include http://*japanese.stackexchange.com/* | |
// @include http://*anime.stackexchange.com/* | |
// ==/UserScript== | |
/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* actions fired when listing/adding/editing posts or pages */ | |
/* admin_head-(hookname) */ | |
add_action( 'admin_head-post.php', 'admin_head_post_editing' ); | |
add_action( 'admin_head-post-new.php', 'admin_head_post_new' ); | |
add_action( 'admin_head-edit.php', 'admin_head_post_listing' ); | |
function admin_head_post_editing() { | |
echo 'you are editing a post'; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
UIFont.familyNames.forEach({ familyName in | |
let fontNames = UIFont.fontNames(forFamilyName: familyName) | |
print(familyName, fontNames) | |
}) |
OlderNewer