Skip to content

Instantly share code, notes, and snippets.

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

Camilo Rodriguez Cuaran thEpisode

🏠
Working from home
View GitHub Profile
@Kirill89
Kirill89 / Dockerfile
Last active March 6, 2023 10:27
Prototype Pollution security vulnerability in minimist
FROM ubuntu:18.04
COPY ./app /app
RUN chmod u+s /app
RUN useradd -s /bin/bash just-user
USER just-user
function isChatMessage(message) {
if (message.__x_isSentByMe) {
return false;
}
if (message.__x_isNotification) {
return false;
}
if (!message.__x_isUserCreatedType) {
return false;
}
@ovidiaconescu
ovidiaconescu / fake-browser.css
Last active December 3, 2021 14:23
Create a browser window out of html and css
.fake-browser {
color: black;
}
.fake-browser-bar {
padding: 10px 8px 6px;
border-top-left-radius: 3px;
border-top-right-radius: 3px;
border-bottom: 2px solid #ccc;
@neilodiaz
neilodiaz / vue-multiple-components.html
Last active August 6, 2020 14:07
VueJS 2.0 Multiple Components - To-Do app
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Multiple Components</title>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="HandheldFriendly" content="True">
<meta name="MobileOptimized" content="320">
<link rel="stylesheet" type="text/css" href="">
@lgarron
lgarron / copyToClipboard.html
Last active December 20, 2023 12:53
Simple `navigator.clipboard.writeText()` polyfill.
<script>
// A minimal polyfill for copying text to clipboard that works most of the time in most capable browsers.
// Note that:
// - You may not need this. `navigator.clipboard.writeText()` works directly in all modern browsers as of 2020.
// - In Edge, this may call `resolve()` even if copying failed.
// - In Safari, this may fail if there is nothing selected on the page.
// See https://github.com/lgarron/clipboard-polyfill for a more robust solution.
//
// License for this Gist: public domain / Unlicense
function writeText(str) {
@ernado-x
ernado-x / ClassGenerator.sql
Created September 9, 2015 08:13
Generate C# class from database table
--from SO: http://stackoverflow.com/questions/5873170/generate-class-from-database-table
declare @TableName sysname = 'TableName'
declare @Result varchar(max) = 'public class ' + @TableName + '
{'
select @Result = @Result + '
public ' + ColumnType + NullableSign + ' ' + ColumnName + ' { get; set; }
'
from
@comerford
comerford / compress_test.js
Created November 12, 2014 16:06
Generating data for MongoDB compression testing
// these docs, in 2.6, get bucketed into the 256 bucket (size without header = 240)
// From Object.bsonsize(db.data.findOne()), the size is actually 198 for reference, so add 16 to that for an exact fit
// with that doc size, 80,000 is a nice round number under the 16MiB limit, so will use that for the inner loop
// We are shooting for ~16 GiB of data, without indexes, so do 1,024 iterations (512 from each client)
// This will mean being a little short (~500MiB) in terms of target data size, but keeps things simple
for(var j = 0; j < 512; j++){ //
bigDoc = [];
for(var i = 0; i < 80000; i++){
@kalinchernev
kalinchernev / countries
Created October 6, 2014 09:42
Plain text list of countries
Afghanistan
Albania
Algeria
Andorra
Angola
Antigua & Deps
Argentina
Armenia
Australia
Austria
@chris-rock
chris-rock / crypto-ctr.js
Last active November 10, 2020 02:27
Encrypt and decrypt text in nodejs
// Part of https://github.com/chris-rock/node-crypto-examples
// Nodejs encryption with CTR
var crypto = require('crypto'),
algorithm = 'aes-256-ctr',
password = 'd6F3Efeq';
function encrypt(text){
var cipher = crypto.createCipher(algorithm,password)
var crypted = cipher.update(text,'utf8','hex')
@geotheory
geotheory / ArrayList.cpp
Last active December 6, 2019 08:53
ArrayList for Arduino, based on code by obedrios but split to working files and updated to include get_item() method. WARNING: code has a memory leak problem that needs addressing - see http://goo.gl/eAWT4R
/*
* Arduino Class for ArrayList
* Written: Obed Isai Rios
*/
#include "Arduino.h"
#include "ArrayList.h"
ArrayList::ArrayList(char* init){