Skip to content

Instantly share code, notes, and snippets.

@wycks
wycks / thing.py
Last active January 30, 2025 00:30
python thing
import numpy as np
import math
import random
import time
def gcd_of_list(lst):
"""Returns GCD of a list of numbers, ignoring zeros."""
filtered_lst = [num for num in lst if num != 0] # Ignore zeros
if not filtered_lst:
return 0 # If all are zeros, return 0
@wycks
wycks / .gitignore
Last active August 29, 2015 14:04
.gitignore
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #
@wycks
wycks / chrome-font-fix.css
Last active December 9, 2016 20:09
Chrome font render order
/* chrome fix render svg first */
@media screen and (-webkit-min-device-pixel-ratio:0) {
@font-face {
font-family: 'LarsseitBold';
src: url('../font/good/larsseit-bold.svg') format('svg');
}
@font-face {
font-family: 'LarsseitExtraBold';
src: url('../font/good/larsseit-extrabold.svg') format('svg');
}
@wycks
wycks / GhettoPress.php
Last active October 8, 2015 05:01
WordPress Ghetto Loader - stop doing this, you
<?php
//Load WorsPress quick and dirty into something not WordPress. This is horrible I know,
//But the database queries they are so low, and it's just so dirty
//install WordPress in a dir like /lib or something and stick classPageLoader.php in there, ha!
//Example use for a index.php or whatever, no autoloading here!
#######################################################
require('lib/classPageLoader.php');
$content = new LoadWpContent();
<?php
//get all ze hooks
$Directory = new RecursiveDirectoryIterator( 'WordPress\3.7' );
$Iterator = new RecursiveIteratorIterator( $Directory );
$regex = new RegexIterator( $Iterator, '/^.+\.php$/i', RecursiveRegexIterator::GET_MATCH );
foreach ( $regex as $filename=>$file ) {
@wycks
wycks / remove-stuff.php
Created October 16, 2013 19:53
Remove stuff is removed from https://github.com/wycks/WP-Skeleton-Theme and is now here.
<?php
/**
* @package WordPress
* @subpackage WP-Skeleton
*/
// REMOVE SOME HEADER OUTPUT
function Wps_remove_header_info() {
remove_action('wp_head', 'rsd_link');
@wycks
wycks / Preferances.sublime-settings.json
Last active December 22, 2015 05:48
Sublime User Settings
{
"auto_complete_selector": "source, text",
"bold_folder_labels": true,
"caret_style": "phase",
"color_scheme": "Packages/Color Scheme - Default/Twilight.tmTheme",
"drag_text": false,
"font_face": "Consolas",
"font_size": 13,
"highlight_line": true,
"highlight_modified_tabs": true,
@wycks
wycks / wp-link-form.html
Created September 1, 2013 05:42
wp-link-form
@wycks
wycks / wp-parse-functions.php
Last active December 21, 2015 05:39
Parse all WP functions
<?php
//just load it the way WP does
include dirname(__FILE__) . '/wp-blog-header.php';
require_once(ABSPATH . 'wp-admin/includes/admin.php');
$functions = get_defined_functions();
$i = 0; //count them
// set to user, we don't want internal functions
@wycks
wycks / meta-box-snip.php
Created July 3, 2013 20:05
Adds meta box to posts, pages and custom post types (including default ones ..attachment, menu and revisions).
<?php
$post_types= get_post_types('','names');
$posts_separated = implode(",", $post_types);
$screens = array( 'post', 'page', $posts_separated);
foreach ($screens as $screen) {
add_meta_box( 'styles', 'hello', 'callback_func', $screen, 'advanced', 'high');
}