Skip to content

Instantly share code, notes, and snippets.

View carloscarucce's full-sized avatar

Carlos Alberto Bertholdo Carucce carloscarucce

View GitHub Profile
@carloscarucce
carloscarucce / treino.cfg
Created August 25, 2020 14:05
comandos treino para CSGO
sv_cheats 1
bot_kick
sv_infinite_ammo 1
ammo_grenade_limit_total 5
sv_grenade_trajectory 1
sv_grenade_trajectory_time 10
sv_showimpacts 1
mp_buytime 9999
mp_buy_anywhere 1
sv_regeneration_force_on 1
@carloscarucce
carloscarucce / node-https-request.js
Last active April 14, 2020 14:01
Node https request example
const https = require('https');
/**
* Make a request
* @param {Object} options
* @param {Object|string} data
*/
const requestSSL = (options, requestData = null) => new Promise((resolve, reject) => {
// eslint-disable-next-line consistent-return
<?php
/**
* Created by PhpStorm.
* User: Carlos Alberto Bertholdo Carucce
* Date: 16/11/2018
* Time: 10:02
*/
class Collection implements \ArrayAccess, \JsonSerializable, \Countable, \Iterator
{
@carloscarucce
carloscarucce / XmlElement.js
Created February 16, 2018 12:23
XmlElement (creates xml in javascript)
/**
* Represents a XML element
*
* @param {string} elementName
* @param {string|function} contentBuilder
* @constructor
*/
var XmlElement = function(elementName, contentBuilder) {
var name = elementName;
@carloscarucce
carloscarucce / imageProxy.php
Last active March 10, 2024 09:55 — forked from nicoptere/imageProxy.php
basic PHP image proxy (that works ... )
<?php
$url = isset($_GET['url']) ? $_GET['url'] : null;
if (!$url) {
die('Please, inform URL');
}
$imgInfo = getimagesize( $url );
@carloscarucce
carloscarucce / custom-checkbox.css
Created March 13, 2017 13:52
Custom checkbox (css + js)
[type="checkbox"].custom-checkbox {
display: none;
}
[type="checkbox"].custom-checkbox + label.custom-checkbox-placeholder {
display: inline-block;
width: 15px;
height: 15px;
margin: 0 5px;
border: 1px solid #444444;
@carloscarucce
carloscarucce / export_to_xls.php
Last active October 31, 2016 14:11
Exports associative array to xls file
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Content-Type: application/force-download");
header("Content-Type: application/octet-stream");
header("Content-Type: application/download");;
header("Content-Transfer-Encoding: binary ");
header("Content-Disposition: attachment; filename=\"file.xls\"");
header("Pragma: no-cache");
header("Expires: 0");
$out = fopen("php://output", 'w');
@carloscarucce
carloscarucce / haversine_geo_distance.sql
Last active September 6, 2016 14:53
Retus the distance based in two geo points (latitude/longitude)
DELIMITER $$
CREATE FUNCTION haversine_geo_distance (lat1 REAL, lon1 REAL, lat2 REAL, lon2 REAL)
RETURNS REAL
BEGIN
DECLARE RR LONG;
DECLARE o1 REAL;
DECLARE o2 REAL;
DECLARE Ao REAL;
DECLARE AA REAL;
class ExampleAdapter extends PagerAdapter {
private List<String> strings;
private Context context;
public ExampleAdapter(Context context){
this.context = context;
strings = new ArrayList<String>();
@carloscarucce
carloscarucce / pagination.blade.php
Last active January 27, 2023 03:10
Pagination template for laravel 5
@if (isset($paginator) && $paginator->lastPage() > 1)
<ul class="pagination">
<?php
$interval = isset($interval) ? abs(intval($interval)) : 3 ;
$from = $paginator->currentPage() - $interval;
if($from < 1){
$from = 1;
}