Skip to content

Instantly share code, notes, and snippets.

View GoldraK's full-sized avatar

goldrak GoldraK

View GitHub Profile
@GoldraK
GoldraK / handlebars-helper-x.js
Created February 15, 2024 09:51 — forked from akhoury/handlebars-helper-x.js
Handlebars random JavaScript expression execution, with an IF helper with whatever logical operands and whatever arguments, and few more goodies.
// for detailed comments and demo, see my SO answer here http://stackoverflow.com/questions/8853396/logical-operator-in-a-handlebars-js-if-conditional/21915381#21915381
/* a helper to execute an IF statement with any expression
USAGE:
-- Yes you NEED to properly escape the string literals, or just alternate single and double quotes
-- to access any global function or property you should use window.functionName() instead of just functionName()
-- this example assumes you passed this context to your handlebars template( {name: 'Sam', age: '20' } ), notice age is a string, just for so I can demo parseInt later
<p>
{{#xif " name == 'Sam' && age === '12' " }}
BOOM
import socket
def send_file(filename, host, port):
client_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
client_socket.connect((host, port))
with open(filename, "rb") as file:
while True:
chunk = file.read(2048) # 2KB chunk size
if not chunk:
@GoldraK
GoldraK / nested.vue
Last active June 14, 2022 16:46
Component to order elements of a list and sublists with Vuetifyjs and Vue.Draggable
<style scoped>
.ghost {
opacity: 0.5;
background: #c8ebfb;
}
.item-sub {
margin: 0 0 0 1rem;
}
@GoldraK
GoldraK / dockernetworkls.sh
Last active August 17, 2020 10:09
Listado de ips en redes docker
#!/bin/bash
docker network inspect $(docker network ls -q) | jq -r '.[] | .IPAM.Config[0].Subnet' | sort -n -t . -k 1,1 -k 2,2 -k 3,3 -k 4,4
javascript:(function () { if (location.hostname !== 'elpais.com') { location.href = 'https://elpais.com/'; } if (localStorage) { const serializedArcp = localStorage.getItem('ArcP'); if (serializedArcp && serializedArcp.length > 0) { const arcp = JSON.parse(serializedArcp); arcp.anonymous.rc[Object.keys(arcp.anonymous.rc)[0]].c = -200; localStorage.setItem('ArcP', JSON.stringify(arcp)); location.reload(); } } })();
@GoldraK
GoldraK / VSelectOther.vue
Last active September 18, 2018 12:42
Component for vuetify, a select with input with input for others, you can configure which item opens the option of others. Thanks @jdonsan @nekosaur for the help.
<template>
<v-container>
<v-layout row>
<v-flex xs12>
<v-select
:items="listitems"
:label="labelSelect"
:item-text="itemtext"
:item-value="itemvalue"
single-line
@GoldraK
GoldraK / breachcompilation.txt
Created December 19, 2017 15:21
1.4 billion password breach compilation wordlist
wordlist created from original 41G stash via:
grep -rohP '(?<=:).*$' | uniq > breachcompilation.txt
Then, compressed with:
7z a breachcompilation.txt.7z breachcompilation.txt
Size: