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
@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"
@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' ]);
@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
@narirou
narirou / easings.js
Last active January 25, 2019 12:57
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],

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
@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
@yashuarc
yashuarc / enable_cors_on_cakephp.php
Last active October 28, 2024 19:32
Enabling CORS on CakePHP
public function beforeFilter() {
parent::beforeFilter();
$this->response->header('Access-Control-Allow-Origin','*');
$this->response->header('Access-Control-Allow-Methods','*');
$this->response->header('Access-Control-Allow-Headers','X-Requested-With');
$this->response->header('Access-Control-Allow-Headers','Content-Type, x-xsrf-token');
$this->response->header('Access-Control-Max-Age','172800');
}
@ReedD
ReedD / AppModel.php
Last active February 18, 2016 07:32
A CakePHP model function to find and sort by the distance from a given a latitude and longitude coordinate with the option to restrict to a given radius.
<?php
App::uses('Model', 'Model');
App::uses('String', 'Utility');
class AppModel extends Model {
/**
* @author Reed Dadoune
* distanceQuery
@branneman
branneman / better-nodejs-require-paths.md
Last active April 11, 2025 10:39
Better local require() paths for Node.js

Better local require() paths for Node.js

Problem

When the directory structure of your Node.js application (not library!) has some depth, you end up with a lot of annoying relative paths in your require calls like:

const Article = require('../../../../app/models/article');

Those suck for maintenance and they're ugly.

Possible solutions

@paulund
paulund / example-wp-list-table.php
Last active January 28, 2025 16:01
An example code of using the WP_List_Table class. With Pagination.
<?php
/*
* Plugin Name: Paulund WP List Table Example
* Description: An example of how to use the WP_List_Table class to display data in your WordPress Admin area
* Plugin URI: http://www.paulund.co.uk
* Author: Paul Underwood
* Author URI: http://www.paulund.co.uk
* Version: 1.0
* License: GPL2
*/