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 NAReadability | |
// @namespace http://script.nar | |
// @description Make NaR.com a bit more readable | |
// @include http://notalwaysright.com/* | |
// ==/UserScript== | |
var cont = document.getElementById('left'); | |
var body = document.getElementsByTagName('body')[0]; | |
var navi = document.getElementsByClassName('wp-pagenavi')[0]; |
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
/** | |
* Warwick | |
* Very small HTML from WordPress. Place at the end of your theme's functions.php | |
* @version 0.8.0 | |
* @link https://gist.github.com/shinmai/add32c1c61750fb6dd58cbf0525b4a9a | |
* @license http://www.wtfpl.net/txt/copying/ WTFPL | |
* @author Aapo Saaristo <[email protected]> | |
*/ | |
class Warwick{protected $html;public function __construct($h){$this->go($h);}public function __toString(){return $this->html;}protected function filter($h){preg_match_all('/<(?<script>script).*?<\/script\s*>|<(?<style>style).*?<\/style\s*>|<!(?<comment>--).*?-->|<(?<tag>[\/\w.:-]*)(?:".*?"|\'.*?\'|[^\'">]+)*>|(?<text>((<[^!\/\w.:-])?[^<]*)+)|/si',$h,$m,PREG_SET_ORDER);$o=false;$r=false;$h='';foreach($m as $t){$ta=(isset($t['tag']))?strtolower($t['tag']):null;$c=$t[0];if(is_null($ta)){$s=!empty($t['script'])||!empty($t['style']);if($c=='<!-- no-minify -->'){$o=!$o;continue;}else if(!$o&&$r!='textarea')$c=preg_replace('/<!--(?!\s*(?:\[if [^\]]+]|<!|>))(?:(?!-->).)*-->/s','',$c);}else if($ta=='pre'||$ta=='textarea')$r=$ta |
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
/** | |
* Expat | |
* Don't include migrate.js in production, if you know you won't need it. | |
* @param string &$scripts enqueued scripts | |
* @version 0.1.0 | |
* @link https://gist.github.com/shinmai/7d5fdbb855850c526af5ae2b36613492 | |
* @license http://www.wtfpl.net/txt/copying/ WTFPL | |
* @author Aapo Saaristo <[email protected]> | |
*/ | |
function expat( &$scripts){ |
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
/** | |
* NoDrama | |
* Excorsise everything blogging-related from Wordpress | |
* @version 0.1.0 | |
* @link https://gist.github.com/shinmai/8448eaa9567fdc11383e42d00d3da8ba | |
* @license http://www.wtfpl.net/txt/copying/ WTFPL | |
* @author Aapo Saaristo <[email protected]> | |
*/ | |
function nbmb(){remove_action('welcome_panel','wp_welcome_panel');$metabox=array('dashboard_incoming_links'=>'normal','dashboard_activity'=>'normal','dashboard_primary'=>'side','dashboard_quick_press'=>'side','dashboard_recent_drafts'=>'side','dashboard_right_now'=>'normal','dashboard_recent_comments'=>'normal','dashboard_secondary'=>'side','wpe_dify_news_feed'=>'normal');foreach($metabox as $id=>$context)remove_meta_box($id,'dashboard',$context);}function nbsm(){$menu=array('edit.php','edit-comments.php','separator1','separator2','separator3');foreach($menu as $main)remove_menu_page($main);remove_submenu_page('tools.php','tools.php');remove_submenu_page('options-general.php','options-writing.php');remove_submenu_page('options-general.php','opt |
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
/** | |
* WeePeeLeeks | |
* All pages are published | |
* @version 1.0.0 | |
* @link https://gist.github.com/shinmai/de0fa9ac20cf4ea6ba8b7ce7cf5c2cf5 | |
* @license http://www.wtfpl.net/txt/copying/ WTFPL | |
* @author Aapo Saaristo <[email protected]> | |
*/ | |
function weepeeleeks( $post ) { | |
if($post['post_type']==='page') |
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
if(!$)var $=a=>{let r=document.querySelectorAll(a);return r.length>1?r:r[0]} // $('.class > div#heading') etc. returns an array if more than one match is found | |
((l,Z)=>{var d=(a)=>{return new Promise((c,d)=>{var b=document.createElement("script");b.onload=c,b.onerror=d,b.async=1,b.src=a,document.head.appendChild(b)})};Promise.all(l.split(",").map(a=>{return d('lib/'+a+'.js')})).then(Z)})( | |
'api,auth,../main', // loads lib/api.js, lib/auth.js & main.js. if your file layout is differnet, edit the call to d() at 2:201 | |
X=>{console.log('scripts loaded')} // callback function to run when scripts have loaded | |
) |
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
cmake_minimum_required(VERSION 3.6) | |
project(vko1) | |
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") | |
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/bin) | |
add_executable("tehtava1-3" "tehtava1-3.cpp") | |
add_executable("tehtava4-6" "tehtava4-6.cpp") | |
add_executable("tehtava7-8" "tehtava7-8.cpp") |
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
Shader "Custom/Curved" { | |
Properties { | |
_MainTex ("Base (RGB)", 2D) = "white" {} | |
_QOffset ("Offset", Vector) = (0,0,0,0) | |
_Dist ("Distance", Float) = 100.0 | |
} | |
SubShader { | |
Tags { "RenderType"="Opaque" } | |
Pass | |
{ |
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
//http://iquilezles.org/www/articles/distfunctions/distfunctions.htm | |
// -- Distant functions | |
float sdPlane( vec3 p ) {return p.y+0.2;} | |
float sdSphere( vec3 p, float s ) {return length(p)-s;} | |
float sdCylinder( vec3 p, vec3 c ){ return length(p.xz-c.xy)-c.z; } | |
float udRoundBox( vec3 p, vec3 b, float r ){return length(max(abs(p)-b,0.0))-r;} | |
float udRoundBoxInf( vec3 p, vec2 b, float r ){return length(max(vec3(abs(p.xz)-b,0.0),0.0))-r;} | |
float maxcomp( vec3 p ) {return max(p.x,max(p.y,p.z));} |
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
//////////////////////////////////////////////////////////////// | |
// | |
// HG_SDF | |
// | |
// GLSL LIBRARY FOR BUILDING SIGNED DISTANCE BOUNDS | |
// | |
// version 2015-12-15 (initial release) | |
// | |
// Check http://mercury.sexy/hg_sdf for updates | |
// and usage examples. Send feedback to [email protected]. |
OlderNewer