Skip to content

Instantly share code, notes, and snippets.

pragma solidity 0.4.24;
import "openzeppelin-solidity/contracts/token/ERC20/ERC20.sol";
import "openzeppelin-solidity/contracts/math/SafeMath.sol";
contract VestingVault12 {
using SafeMath for uint256;
using SafeMath for uint16;
@EmadAdly
EmadAdly / SSL-renewal.md
Last active June 11, 2024 10:48
Renew The Let’s Encrypt Certificate in bitnami

Renew The Let’s Encrypt Certificate

Let’s Encrypt certificates are only valid for 90 days. To renew the certificate before it expires, run the following commands from the server console as the bitnami user. Remember to replace the DOMAIN placeholder with your actual domain name, and the EMAIL-ADDRESS placeholder with your email address.

1- Login your server using SSH

ssh -i Key.pem bitnami@00.00.00.00

2- Stop Apache Server

sudo /opt/bitnami/ctlscript.sh stop

@prodrammer
prodrammer / commands.js
Last active March 16, 2020 16:47
vuedraggable / sortablejs support files for cypress.io
/// <reference types="Cypress" />
import draggable from './draggable'
// drag and drop a source element to a target selector, anchoring the drop to the given
// position of the selector. positions are the same as the cypress trigger command
Cypress.Commands.add('drop', { prevSubject: 'element' }, ($source, selector, position) => {
cy.get(selector).then($target => {
const source = $source[0]
const target = $target[0]
draggable(source, target, position)
@judy2k
judy2k / parse_dotenv.bash
Created March 22, 2017 13:34
Parse a .env (dotenv) file directly using BASH
# Pass the env-vars to MYCOMMAND
eval $(egrep -v '^#' .env | xargs) MYCOMMAND
# … or ...
# Export the vars in .env into your shell:
export $(egrep -v '^#' .env | xargs)
@mistercoffee66
mistercoffee66 / jquery-dosomething-ES6.js
Last active November 6, 2019 16:03
ES6 module importing jQuery plugin
//jquery-dosomething-ES6.js
//after modification
//assumes jQuery is avail as global or via NPM etc
import jQuery from 'jquery'
export default function() {
+function($) {
var $this = $(this);
var newText = $this.data('text');
@postspectacular
postspectacular / gist:453c72b62f47d870cce0
Created November 5, 2014 14:32
ffmpeg animated gif (optionally w/ watermark)
# 12fps resize to 640x360
ffmpeg -f image2 -r 12 -i frame-%04d.png -pix_fmt rgb24 -r 12 -s 640x360 anim.gif
# with watermark
ffmpeg -f image2 -r 12 -i frame-%04d.png -pix_fmt rgb24 -r 12 -s 640x360 -vf "movie=credits.png [watermark]; [in][watermark] overlay=10:10 [out]" anim.gif
@lukaswhite
lukaswhite / elasticsearch-on-homestead.txt
Created August 3, 2014 08:58
Installing Elasticsearch on Laravel Homestead
# Install Java
sudo apt-get install openjdk-7-jre-headless -y
# Download & install the Public Signing Key
wget -qO - http://packages.elasticsearch.org/GPG-KEY-elasticsearch | sudo apt-key add -
# Add the following to /etc/apt/sources.list
deb http://packages.elasticsearch.org/elasticsearch/1.3/debian stable main
# Update Aptitude
@floptwo
floptwo / php-cli_ovh_mutu.md
Last active April 25, 2023 08:40
OVH PHP-CLI

PHP-CLI (PHP en ligne de commande) sur les hébergements mutualisés OVH

More complete info here http://cluster015.ovh.net/infos/ (thanks to @42antoine)

(cli)

/usr/local/php5.3/bin/php => PHP 5.3.29 (cli) (built: Nov 21 2017 08:55:07)
/usr/local/php5.4/bin/php => PHP 5.4.45 (cli) (built: Nov 21 2017 08:35:51)
/usr/local/php5.5/bin/php => PHP 5.5.38 (cli) (built: Nov 21 2017 08:46:45)
@atomicpages
atomicpages / fbUrlCheck.php
Created January 24, 2013 09:37
A simple facebook URL checker RegEx for PHP or JavaScript
<?php
/**
* A simple regex to test whether or not a facebook url is valid. For basic usage, this will do the job.
* @see Test cases <http://ideone.com/ZMJp4f>
*/
$fbUrlCheck = '/^(https?:\/\/)?(www\.)?facebook.com\/[a-zA-Z0-9(\.\?)?]/';
$secondCheck = '/home((\/)?\.[a-zA-Z0-9])?/';
$validUrl = 'https://www.facebook.com/atomicpages/';