Skip to content

Instantly share code, notes, and snippets.

View YuriFontella's full-sized avatar
💭
sad dev

Yuri Fontella YuriFontella

💭
sad dev
  • Porto Alegre - RS
View GitHub Profile
@mul14
mul14 / encrypto.js
Created October 15, 2018 17:05
Node.js v10 - crypto.createDecipheriv()
// This is example of using crypto.createCipheriv(), because
// crypto.createCipher() is deprecated since Node.js v10
const crypto = require('crypto')
const encrypto = {
encrypt(text, password) {
const key = password.repeat(32).substr(0, 32)
const iv = password.repeat(16).substr(0, 16)
@joseluisq
joseluisq / inotify_arch_linux.md
Last active April 10, 2022 12:08
Increasing the amount of inotify watchers in Arch Linux

Increasing the amount of inotify watchers in Arch Linux

If you are running ArchLinux, run the following command instead (see here for why):

echo fs.inotify.max_user_watches=524288 | sudo tee /etc/sysctl.d/40-max-user-watches.conf && sudo sysctl --system

Then paste it in your terminal and press on enter to run it.

@eugene-kim
eugene-kim / minimap_setting.py
Created October 26, 2017 16:31
Hide minimap in Sublime Text 3 by default.
# -*- encoding: utf-8 -*-
# Save it as minimap_setting.py in the User directory (in Preferences -> Browse Packages).
# Then, you just add "show_minimap": false in your settings and you're good to go!
import sublime
import sublime_plugin
class MinimapSetting(sublime_plugin.EventListener):
/*
* Geminid III. TCP/UDP/ICMP Packet flooder
*
*
* Usage: geminid [-T -U -I -N -s -h -d -p -q -l -t]
*
* -T TCP attack [0:ACK, 1:FIN, 2:RST, 3:SYN] (no default )
* -U UDP attack (no options )
* -I ICMP attack (no options )
* -N Bogus No flag attack (no options )
@james2doyle
james2doyle / vue.pretty-bytes.filter.js
Last active November 28, 2021 01:07
Vue.js pretty bytes filter. This filter formats bytes into human readable formats
// usage: {{ file.size | prettyBytes }}
Vue.filter('prettyBytes', function (num) {
// jacked from: https://github.com/sindresorhus/pretty-bytes
if (typeof num !== 'number' || isNaN(num)) {
throw new TypeError('Expected a number');
}
var exponent;
var unit;
var neg = num < 0;
= Arch Linux step-by-step installation =
= http://blog.fabio.mancinelli.me/2012/12/28/Arch_Linux_on_BTRFS.html =
== Boot the installation CD ==
== Create partition ==
cfdisk /dev/sda
* Create a partition with code 8300 (Linux)
@azakordonets
azakordonets / encryptPassWordWithCryptoJs.js
Last active July 25, 2022 10:21
This gist describes how to encode password with salt using SHA256 algorithm. It shows how to do it with google crypto-js library and Node.js module crypto
var CryptoJS = require('crypto-js');
var algo = CryptoJS.algo.SHA256.create();
algo.update(password, 'utf-8');
algo.update(CryptoJS.SHA256(salt), 'utf-8');
var hash = algo.finalize().toString(CryptoJS.enc.Base64);
console.log(hash);
anonymous
anonymous / index.html
Created March 6, 2015 16:54
vCard with fold-out links
<div class="vcard">
<div class="bio">
<img src="http://ianlunn.co.uk/wp-content/uploads/avatar.jpg" alt="Ian Lunn" />
<h1>Ian Lunn</h1>
<h2>Front End Developer</h2>
<p>Ian uses the latest web technologies to build creative and effective websites. Creator of open-source projects <a href="http://ianlunn.github.io/Hover/" target="_blank">Hover.css</a>, <a href="http://sequencejs.com/" target="_blank">Sequence.js</a>, and author of <a href="http://css3foundations.com/" target="_blank">CSS3 Foundations</a>.</p>
@ruario
ruario / README.md
Last active January 7, 2023 20:52
Installs (or updates) PPAPI Flash, so that it can be used by Chromium-based browsers

Usage

If you use Ubuntu or a derivative distro, issue the following to install an appropriate version of Flash:

sudo add-apt-repository "deb http://archive.canonical.com/ubuntu `lsb_release -cs` partner" 
sudo apt update
sudo apt install adobe-flashplugin

If your distro does not provide a copy of Pepper Flash that works with Vivaldi, this script will download and install it for you. To use, click on the "Download ZIP" button listed on the GitHub Gist page and then unpack the .zip archive locally. You should now have a directory containing the file "latest-pepper-flash.sh".