View gist:6a5f54baf0425655c174
1 2 3 4 5 6 7 8 9 10
<?php
/**
* Destroy Session on User Logout
*/
function clear_session_on_logout() {
$current_user = wp_get_current_user();
View gentoo menu in python
1 2 3 4 5 6 7 8 9 10
#!/usr/bin/env python3
import subprocess
 
# save the script to /usr/local/bin/qe.py
def my_cmd(thecommand):
return_code = subprocess.call(thecommand, shell=True)
def my_quit_fn():
raise SystemExit
View KeyboardHeight
1 2 3 4 5 6 7 8 9 10
// Add this to viewDidLoad()
NSNotificationCenter.defaultCenter().addObserver(self,
selector: "keyboardShown:", name: UIKeyboardDidShowNotification, object: nil)
 
// This function handles notification
func keyboardShown(notification: NSNotification) {
let info = notification.userInfo!
let value: AnyObject = info[UIKeyboardFrameEndUserInfoKey]!
 
let rawFrame = value.CGRectValue()
View keybase.md

Keybase proof

I hereby claim:

  • I am xeno-by on github.
  • I am xeno_by (https://keybase.io/xeno_by) on keybase.
  • I have a public key whose fingerprint is FE5A 8474 50B9 0939 A0A5 6C10 E512 F2A2 36EE 59D9

To claim this, I am signing this object:

View cache.php
1 2 3 4 5 6 7 8 9 10
<?php
/**
* Clear cache cli style
*
*
* @category Mage
* @package Mage_Shell
* @copyright Copyright (c) 2015 Bjarne Oeverli (http://bjarneo.codes)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/
View remove-rev-slider-metabox.php
1 2 3 4 5 6 7 8 9 10
/**
* Remove Rev Slider Metabox
*/
if ( is_admin() ) {
function remove_revolution_slider_meta_boxes() {
remove_meta_box( 'mymetabox_revslider_0', 'page', 'normal' );
remove_meta_box( 'mymetabox_revslider_0', 'post', 'normal' );
remove_meta_box( 'mymetabox_revslider_0', 'YOUR_CUSTOM_POST_TYPE', 'normal' );
}
View pyvideo_popularity.py
1 2 3 4 5 6 7 8 9 10
#!/usr/bin/env python3
# encoding: utf-8
 
"""
I saw a similar script on the homepage of Miguel Grinberg (the Flask book guy),
but he was using webscraping. Here I use simple API calls instead.
The script takes the presentations of a Python conference and orders the
presentations in descending order by the number of youtube views. It
is an indicator about the popularity of a video.
View clk.tsv
1 2
2014-03-04 15dfb8e6cc4111e3a5bb600308919594 11
2014-03-06 81da510acc4111e387f3600308919594 61
View pubsub_memory_database.rst

クエリー処理を Lua で書け、処理結果を PubSub で共有できるキュー付きオンメモリデータベース

作者: @voluntas
バージョン: 0.1.3
URL: https://voluntas.github.io/

まだ個人の興味で作ってるだけです

View wsgi.py
1 2 3 4 5 6 7 8 9 10
#!/usr/bin/env python3
# -*- mode: python; coding: utf-8 -*-
 
assert str is not bytes
 
import my_example_1_wsgi as _my_example_1_wsgi
import my_example_2_wsgi as _my_example_2_wsgi
import my_example_3_wsgi as _my_example_3_wsgi
 
_application_by_host_dict = {
Something went wrong with that request. Please try again.