Discover gists
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 namespace App\Providers; | |
use Illuminate\Support\ServiceProvider; | |
/** | |
* If the incoming request is an OPTIONS request | |
* we will register a handler for the requested route | |
*/ | |
class CatchAllOptionsRequestsProvider extends ServiceProvider { |
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 | |
/* | |
I wrote this function to progressively obfuscate text in MAKEbook.io. When it KINDA worked, I just used it. | |
It can take a lot of improvement. I kinda just tweaked the values until it was good enough. It's not SO progressive though. | |
It takes all the output of your PHP scripts via ob_start(), reroutes that to the obfuscation function. | |
You should check if user paid for book or not, then either run ob_start or not! | |
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
Install libimobiledevice on Mac OS X | |
So you'd like to manage your iOS devices by command line? | |
You can use libimobiledevice tools for that. | |
Easy on Linux. Let's see how it is on Mac OS X. | |
You'll need to: | |
1. install Xcode | |
2. start Xcode and agree to it's license | |
3. install Xcode command line tools (Start Xcode, Go to Preferences -> Downloads tab) | |
4. install homebrew by this command (sudo password will be prompted) |
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
;; Challenge: find all the bugs in this small functional compiler | |
#lang racket | |
(provide (all-defined-out)) | |
(define verbose-mode (make-parameter #t)) | |
(define i-am-a-mac (make-parameter #f)) | |
;; | |
;; Our compiler will have several layers |
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 Foundation | |
import SwiftUI | |
struct TappableColoredText: View { | |
enum Component { | |
case text(String) | |
case tappable(String, () -> Void) | |
} | |
let components: [Component] |
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
all: build test clean | |
test: | |
@echo "========== Internal Domains ==========" | |
dig @127.0.0.1 haas.example.com +short | |
dig @127.0.0.1 pihole.example.com +short | |
dig @127.0.0.1 plex.example.com +short | |
dig @127.0.0.1 go +short | |
dig @127.0.0.1 modem +short |
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 | |
$script = new TElement('script'); | |
$script->type = 'text/javascript'; | |
$script->add(" | |
$(document).ready(function(){ | |
window.setTimeout(function(){ | |
var results = new RegExp('[\\?&]class=([^&#]*)').exec(window.location.href); | |
if('".__CLASS__."' == results[1] ) | |
__adianti_load_page('index.php?class=DashboardEmpresa&method=onReload'); |
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 function onReload($param = NULL) | |
{ | |
try | |
{ | |
if( in_array(1, TSession::getValue('usergroupids')) == 1 ) | |
{ | |
// se estiver dentro do grupo admin carrega os dados. | |
// para incluir usuário específico substituir a condição por if(TSession::getValue('userid') == 1) | |
} | |
elseif (empty($_REQUEST['method']) || ($_REQUEST['method'] == 'onShow')) |
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 | |
/* | |
* link original: https://www.adianti.com.br/framework_files/tutor/index.php?class=SaleMultiValueForm | |
*/ | |
/** | |
* SaleForm Registration | |
* @author <your name here> | |
*/ | |
class SaleMultiValueForm extends TPage |
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
package main | |
import ( | |
"net/http" | |
) | |
func main() { | |
finish := make(chan bool) | |
server8001 := http.NewServeMux() |
NewerOlder