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
SELECT | |
perm.id, | |
aco_child.alias as controller, | |
aco_parent.alias as action, | |
_create,_read,_update,_delete, | |
requester.model as requester_type | |
FROM | |
acos as aco_child | |
JOIN acos as aco_parent ON aco_child.id = aco_parent.parent_id | |
JOIN aros_acos as perm ON perm.id = aco_parent.id |
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 | |
//Helpers | |
function s($text){ | |
return "\"".trim($text," }{")."\""; | |
} | |
function m1($m){ | |
return s($m[1]) . ":" . s($m[2]); | |
} | |
function m2($m){ |
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
//JQUERY version | |
$(document).ready(function(){ | |
function imgPlaceholders(tc,bgc,datr){ | |
function createPlaceholder(w,h,s){ | |
var canvas = $('<canvas>'); | |
var canvasr = canvas[0]; | |
canvas.attr('width',w).attr('height',h); | |
var ctx = canvasr.getContext('2d'); | |
ctx.fillStyle = bgc; | |
ctx.fillRect(0,0,w,h); |
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 | |
$x = range(40,45,0.25); | |
$y = range(20,29,0.25); | |
// var_dump($x); | |
$v = 43.1; | |
$v2 = 21.4; | |
function get4GridPoints($xrange,$yrange,$x,$y,$eps = 0.25){ |
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 | |
function jpegStrip($path){ | |
$image = imagecreatefromjpeg($path); | |
list ($w, $h) = getimagesize($path); | |
$height = ( 40*$h / $w ); | |
$thumb = imagecreatetruecolor(40, $height); | |
imagecopyresized($thumb,$image,0,0,0,0,40,$height,$w,$h); |
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://img-9gag-fun.9cache.com/photo/<ID>_460sv.webm | |
http://img-9gag-fun.9cache.com/photo/<ID>_700b.jpeg |
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 urllib3 | |
import sys,os | |
import argparse,jsbeautifier | |
from bs4 import BeautifulSoup | |
from bs4 import UnicodeDammit | |
def writeScript(path,data): | |
#Nice side effect bruh | |
print('Writing to :=',path) | |
f = open(path,'w',encoding="utf-8") |
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
function drawImageScaled(src,w,h,callback) { | |
var img = $('<img>').attr('src',src); | |
img.on('load',function(){ | |
var image = img[0]; | |
var canvas = $('<canvas>').attr('width',w).attr('height',h)[0]; | |
var ctx = canvas.getContext("2d"); | |
// var canvas = ctx.canvas ; | |
var hR = canvas.width / image.width ; | |
var vR = canvas.height / image.height ; |
OlderNewer