Skip to content

Instantly share code, notes, and snippets.

View tracend's full-sized avatar
🎯
Focusing

✌ Makis Tracend tracend

🎯
Focusing
View GitHub Profile
@Ray33
Ray33 / gist:ba189a729d81babc99d7cef0fb6fbcd8
Last active July 22, 2022 10:50 — forked from SamCyanide/gist:780afff4c3e1a9e105264c2a476e037c
Amazon Elastic Network Adapter (ENA) on CentOS 7
sudo su
yum --enablerepo=extras install epel-release
yum -y install patch dkms kernel-devel perl
yum update
#Required for kernel num 5:
yum --enablerepo=elrepo-kernel -y install kernel-ml-devel
reboot
@joshschmelzle
joshschmelzle / ffmpeg-cut-out-video.cmd
Created November 29, 2016 18:17
Cut a video without re-encoding with ffmpeg
ffmpeg -i input.mp4 -c copy -ss 00:04:25.000 -to 00:09:25.000 output.mp4
@strangerstudios
strangerstudios / pmpro_checkout_end_date_example.php
Created April 1, 2016 16:00
Setup Level 3 to start next Monday and end the following Monday with Paid Memberships Pro.
/*
Setup Level 3 to start next Monday and end the following Monday
Requires PMPro 1.8.9 or higher.
Add this code to your active theme's functions.php or a custom plugin.
*/
//startdate
function my_pmpro_checkout_start_date($enddate, $user_id, $level) {
if($level->id == 3)
@RJ
RJ / vmware-ec2.md
Last active February 1, 2023 13:18
Exporting VMWare images (OVA) from EC2

How to provision VMWare compatible .ova images on EC2

EC2 only lets you export instances as VMWare-compatible OVA files if you originally imported that instance from an OVA. Presumably it preserves the metadata and XML gubbins for the instance, and just wraps it up again using that metadata on export.

In order to provision arbitrary VMs in an OVA-exportable way, we abuse the volume snapshots on one VM.

Prep work:

  • Make a fresh install of ubuntu server or whatever your base distro is, in VMWare, export as OVA file. (single disk only!)
  • Untar the OVA and import the VMDK file into ec2 using ec2-instance-import onto an HVM instance type (ie, no xen kernel needed)
@tracend
tracend / build.js
Last active August 29, 2015 14:07
Build script using Node.js
// # Build script using Node.js
//
// Single script build,used as a lightweight alternative
// when a build platform (grunt/gulp wtc.) feels like overkill
//
// - Dependencies: NPM/Node.js
// - Conventions:
// * code is in a lib/ folder with a main.js as the main context (closure)
// * a package.json on the root contains all the info about the lib: name, description, author, license
// * compiled files are saved in a build folder
@esimov
esimov / simplexnoise.js
Created October 6, 2014 08:47
Simplex noise implementation in Javascript
var NOISE = NOISE || { };
NOISE.Simplex = (function() {
var iOctaves = 1,
fPersistence = 0.5,
fResult, fFreq, fPers,
aOctFreq, // frequency per octave
aOctPers, // persistance per octave
fPersMax; // 1 / max persistence
@douglascorrea
douglascorrea / install-nodejs-amazon-ec2-centos
Last active July 7, 2019 09:46
Install NodeJS on Amazon Linux EC2 (CentOS)
sudo yum install openssl openssl-devel
sudo yum groupinstall "Development Tools"
sudo yum install git-core
git clone git@github.com:nodejs/node.git
cd node
./configure
make
@wbs75
wbs75 / .bashrc
Last active May 27, 2017 13:20
.bashrc -> CentOS
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
[ -f /etc/bash_completion ] && source /etc/bash_completion
alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'
# Source global definitions
@ryndel
ryndel / .float-label.md
Last active November 2, 2017 11:45
Float label css only solution

Float label

A web component that create a CSS-only floating label for input tags

Usage

The syntax for generating a float-label input is as follows:

@krry
krry / Canseco: A Juiced-up Bash Profile
Last active August 29, 2015 13:56
the .bashrc that ain't afraid to bash
###########################################################
#
# CANSECO
# a World Series-class .bashrc file
#
# Canseco draws from a few others' shell profiles, namely:
# killfall's ===> https://github.com/killfall/terminal-piperita
# and another couple I can't place at the moment
#
###########################################################