Skip to content

Instantly share code, notes, and snippets.

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

Martin Cruz codepainkiller

🏠
Working from home
View GitHub Profile
@codepainkiller
codepainkiller / detox-template.json
Last active November 24, 2023 02:23
Detox Data
[
{
"name": "Nombre detox 1",
"description": "Descripcion",
"level": "Nivel 1",
"category": "Categoria de ejemplo",
"procedures": [
{
"task": "Tarea 1",
"sentence": "Frase de ejemplo",
@codepainkiller
codepainkiller / cycle-metasyntactic-variables.vim
Created November 16, 2018 20:19 — forked from hail2u/cycle-metasyntactic-variables.vim
'foo', 'bar', 'baz', 'qux', 'quux', 'corge', 'grault', 'garply', 'waldo', 'fred', 'plugh', 'xyzzy', 'thud'の上で<C-a>/<C-x>すると順にサイクルしてくれるやつ。レジスター使ってる。
" Cycle metasyntactic variables
function! s:CycleMetasyntacticVariables(num)
if type(a:num) != type(0)
return
endif
let vars = ['foo', 'bar', 'baz', 'qux', 'quux', 'corge', 'grault', 'garply', 'waldo', 'fred', 'plugh', 'xyzzy', 'thud']
let cvar = expand('<cword>')
let i = index(vars, cvar)
@codepainkiller
codepainkiller / countries.json
Created November 14, 2018 02:26 — forked from smitroshin/countries.json
Countries - name, dial_code, code
[
{
"name": "Afghanistan",
"dial_code": "+93",
"code": "AF"
},
{
"name": "Aland Islands",
"dial_code": "+358",
"code": "AX"
@codepainkiller
codepainkiller / gist:921b7bcb789aff87d85989da9e09d575
Created November 9, 2018 15:47
React Native run android fixes
adb reverse tcp:8081 tcp:8081
@codepainkiller
codepainkiller / ajax_upload_file.js
Created September 14, 2018 23:06
Ajax Upload file
$('#form').on('submit', function (e) {
e.preventDefault();
const formData = new FormData(this);
$.ajax({
method: 'post',
url: '/ajax/path',
data: formData,
cache: false,
contentType: false,
@codepainkiller
codepainkiller / mdb_laravel_grouby.php
Last active August 28, 2018 12:14
MongoDB Laravel - Group By
<?php
namespace App\Http\Controllers\Admin;
use App\Appointment;
use Carbon\Carbon;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use MongoDB\BSON\UTCDateTime;
@codepainkiller
codepainkiller / Laravel PHP7 LEMP AWS.md
Created June 5, 2017 15:16 — forked from santoshachari/Laravel PHP7 LEMP AWS.md
Laravel 5.x on Ubuntu 16.x, PHP 7.x, Nginx 1.9.x

#Steps to install latest Laravel, LEMP on AWS Ubuntu 16.4 version. This tutorial is the improvised verision of this tutorial on Digitalocean based on my experience.

Install PHP 7 on Ubuntu

Run the following commands in sequence.

sudo apt-get install -y language-pack-en-base
sudo LC_ALL=en_US.UTF-8 add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install zip unzip
#include <iostream>
using namespace std;
class Nodo {
public:
int dato;
int fe; // factor de equilibrio
Nodo* izquierdo;
Nodo* derecho;
@codepainkiller
codepainkiller / final_m101p.js
Last active March 18, 2017 00:37
Final Exam M101P
// Question 1
db.messages.find({
$and: [
{"headers.From": "andrew.fastow@enron.com"},
{"headers.To": {$in: ["jeff.skilling@enron.com"]}}
]
}).count();
// Question 2
@codepainkiller
codepainkiller / m101p_hw5.1.js
Last active June 27, 2018 15:02
M101P - Week 5
db.posts.aggregate([
{
$unwind: "$comments"
},
{
$group: {
_id: "$comments.author",
count: {$sum: 1}
}
},