Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
docker run --name "persist" \
-v /persistance \
-it \
--rm \
alpine:latest \
/bin/sh
const crypto = require('crypto')
const searchStr = process.argv[2] || 'deadbeef'
const start = process.argv[3] || 42
const hasher = function *() {
let acc = start
while (true) {
yield [crypto
.createHash('md5')
#!/bin/sh
BACKUP_NAME=dot-ssh-$(date +%Y-%m-%d).tar.gz
echo "[*] compressing ~/.ssh/ to ./$BACKUP_NAME"
tar czf $BACKUP_NAME ~/.ssh
echo "[*] the following files were backed up"
tar -tvf $BACKUP_NAME
`.-:::://:::-.`
`-/oyhhyhhhhdhhyyyyyhhss/-`
`:oyhhhyoo/hysyysysoyyys+soyhhhs+-`
:sdddyso.hs`oyys+/-//ossyo-ho/+o+syyyo-
.+dmmho-hoh/ossy+:-..``.--:+sysh/s-/+s+sysy+`
`+dmds+/ho+syyso/-``` `:``...:+osyhsss:-o/oyyh+`
/hdd+hy/+yhhyyyo/..` .-.- ``-:/+oooshhyhs-/+yys:
`sdhs:/:shhhyhyoo/-`` -+::+/ ``.:/+++osssoo+s/-os+o`
.yyssyy+ssysssso//-.` .++sysy: `.-////++/:/oso/s-+ooo.
-ssso://s+o+/+++/+/:-` -:`..-:-/. `-/+/:-::-::/+++/.o+//+.
@t3h2mas
t3h2mas / three.js
Created October 6, 2016 05:23
three.js take 2 -- cryptopals
const xor = (str, key) =>
Buffer.from(str, 'hex').map(byte => byte ^ key);
const getFreq = (str) =>
str.toLowerCase().split('').reduce((result, item) => {result[item] = (result[item] || 0) + 1; return result}, {});
const weightFreq = (str) => {
const letterWeights = {
e: 0.12702,
t: 0.09056,
@t3h2mas
t3h2mas / three.js
Created October 5, 2016 06:53
cryptopals set 1 challenge 3
const xor = (str, key) =>
Buffer.from(str, 'hex').map(byte => byte ^ key);
const getFreq = (str) =>
str.toLowerCase().split('').reduce((result, item) => {result[item] = (result[item] || 0) + 1; return result}, {});
const weightFreq = (str) => {
const letterWeights = {
e: 12.702,
t: 9.056,
This file has been truncated, but you can view the full file.
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId])
/******/ return installedModules[moduleId].exports;
@t3h2mas
t3h2mas / Recipe.js
Created September 4, 2016 04:44
Recipe.js
import React, { Component } from 'react';
import Ingredient from './Ingredient';
class Recipe extends Component {
constructor(){
super();
this.showDetail = this.showDetail.bind(this);
this.remove = this.remove.bind(this);
}
showDetail(){
@t3h2mas
t3h2mas / RecipeBox.js
Created September 4, 2016 04:38
Remove Recipe callback concern
import React from 'react';
import Recipe from './Recipe';
const RecipeBox = (props) => {
const removeRecipe = props.removeRecipe; // scope to `.map`
let recipeNodes = props.recipes.map((recipe) => {
return <Recipe
name={recipe.name}
ingredients={recipe.ingredients}
id={recipe.id}
@t3h2mas
t3h2mas / recipeApp.js
Created September 4, 2016 03:11
immutable(silly)
return Object.assign(
{},
state,
{
recipes: [
...state.recipes,
{
name: action.name,
action: action.ingredients,
id: state.recipes.length