Skip to content

Instantly share code, notes, and snippets.

View n0mad01's full-sized avatar
🏡
Working from home

Adrian Soluch n0mad01

🏡
Working from home
View GitHub Profile
@turret-io
turret-io / aes_enc_dec.php
Last active March 26, 2025 08:04
AES encryption/decryption in PHP
<?php
// DEFINE our cipher
define('AES_256_CBC', 'aes-256-cbc');
// Generate a 256-bit encryption key
// This should be stored somewhere instead of recreating it each time
$encryption_key = openssl_random_pseudo_bytes(32);
// Generate an initialization vector
// This *MUST* be available for decryption as well

Disclaimer: This is an unofficial post by a random person from the community. I am not an official representative of io.js. Want to ask a question? open an issue on the node-forward discussions repo

io.js - what you need to know

io-logo-substack

  • io is a fork of node v0.12 (the next stable version of node.js, currently unreleased)
  • io.js will be totally compatible with node.js
  • the people who created io.js are node core contributors who have different ideas on how to run the project
  • it is not a zero-sum game. many core contributors will help maintain both node.js and io.js
@narirou
narirou / easings.js
Last active June 25, 2025 21:21
Cubic-Bezier Easing Collections for Velocity.js
module.exports = {
easeIn: 'ease-in',
easeOut: 'ease-out',
easeInOut: 'ease-in-out',
snap: [0.000, 1.000, 0.500, 1.000],
linear: [0.250, 0.250, 0.750, 0.750],
easeInQuad: [0.550, 0.085, 0.680, 0.530],
easeInCubic: [0.550, 0.055, 0.675, 0.190],
easeInQuart: [0.895, 0.030, 0.685, 0.220],
easeInQuint: [0.755, 0.050, 0.855, 0.060],
@beci
beci / gcc 5 on ubuntu 14.04
Created October 15, 2015 07:18
use gcc 5.x on ubuntu 14.04
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install gcc-5 g++-5
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-5 60 --slave /usr/bin/g++ g++ /usr/bin/g++-5
@laverboy
laverboy / LogUse.php
Last active June 4, 2024 06:56
A simple, static, logging singleton class
<?php
Log::info("something really interesting happened", ['extra' => 'information', 'about' => 'anything' ]);
@n0mad01
n0mad01 / gist:9f6a2aeebfb636566539
Last active November 16, 2015 13:39
bitcoind with Berkeley DB setup on Ubuntu
https://github.com/bitcoin/bitcoin/blob/master/doc/build-unix.md
cd /home/user/bitcoin
ls -la
drwxrwxr-x 12 user user 4096 Nov 16 14:10 bitcoin
drwxrwxr-x 6 user user 4096 May 10 2015 db4
BITCOIN_ROOT=$(pwd)
BDB_PREFIX="${BITCOIN_ROOT}/db4"
@btroncone
btroncone / ngrxintro.md
Last active July 5, 2025 14:15
A Comprehensive Introduction to @ngrx/store - Companion to Egghead.io Series

Comprehensive Introduction to @ngrx/store

By: @BTroncone

Also check out my lesson @ngrx/store in 10 minutes on egghead.io!

Update: Non-middleware examples have been updated to ngrx/store v2. More coming soon!

Table of Contents

@varmais
varmais / functions.php
Last active April 5, 2018 14:36
Fetch all latest Wordpress posts when using Polylang plugin
<?php
function get_default_language_posts($query)
{
if ($query->is_main_query() && is_home() && function_exists('pll_languages_list') && !is_admin()) {
$languages = pll_languages_list(array('hide_empty' => 1));
$terms = get_terms('post_translations');
$lang_default = pll_default_language();
$lang_current = pll_current_language();
$post_ids = array();
@dreikanter
dreikanter / encrypt_openssl.md
Last active May 23, 2025 13:12 — forked from crazybyte/encrypt_openssl.txt
File encryption using OpenSSL

Symmetic encryption

For symmetic encryption, you can use the following:

To encrypt:

openssl aes-256-cbc -salt -a -e -in plaintext.txt -out encrypted.txt

To decrypt:

@n0mad01
n0mad01 / app.php
Last active November 22, 2016 10:15
Simple Bootstrap Alert Slim/Twig Macro
/**
* Using PHP Slim Frameworks slim/flash
* https://www.slimframework.com/docs/features/flash.html
*
* Assuming this is called from within a Slim route $app->get()
*/
$this->flash->addMessage('success', 'Some success message');