Skip to content

Instantly share code, notes, and snippets.

View benfavre's full-sized avatar
💻
At the office

Webdesign29 benfavre

💻
At the office
View GitHub Profile
#!/bin/bash
set -e
GVERSION="1.10.3"
GFILE="go$GVERSION.linux-amd64.tar.gz"
GOPATH="$HOME/go"
GOROOT="/usr/local/go"
if [ -d $GOROOT ]; then
echo "Installation directory already exists $GOROOT"
@benfavre
benfavre / lisk curl
Created June 28, 2018 22:14
Lisk enable / check forging status
curl -X PUT \
http://127.0.0.1:7000/api/node/status/forging \
-H 'cache-control: no-cache' \
-H 'content-type: application/json' \
-d '{
"publicKey": "YYYYYYYYY",
"password": "XXX",
"forging": true
}'
@benfavre
benfavre / git-pull-all
Created June 28, 2018 16:11 — forked from grimzy/git-pull-all
Git pull all remote branches
#!/usr/bin/env bash
git branch -r | grep -v '\->' | while read remote; do git branch --track "${remote#origin/}" "$remote"; done
git fetch --all
git pull --all
# Update & Upgrade the System
sudo apt-get update
sudo apt-get upgrade
# Install dependencies there might be more based on your system
# However below instructions are for the fresh Ubuntu install/server
# Please carefully watch the logs because if something could not be install
# You have to make sure it is installed properly by trying the command or that particular
# dependency again
# Install brew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# Install composer
brew install homebrew/php/composer
### PHPCS
composer global require "squizlabs/php_codesniffer=*"
# Add to your .bash_profile
<?php
function listingAvis ()
{
ob_start ();
?>
Cool
<?php
$output_string = ob_get_contents ();
ob_end_clean ();
return $output_string;
@benfavre
benfavre / shortcode.php
Created March 22, 2018 15:31
shortcode
<?php
function listingAvis ()
{
$taxonomy = array(
'fr' => 424,
'en' => 326
);
$taxId = $taxonomy[ pll_current_language () ];
ob_start ();
// WP_Query arguments
@benfavre
benfavre / genesis_public_key
Created March 5, 2018 12:08
genesis_public_key
0478b2be4c02ac16048103b2d8c4e8e28ac110c793814106b7a1a0fa66bdb079c4b4fe738b1c8b2bc743935215ae4a362223b17529efbfef958782e26ce6c98023;romanornr
@benfavre
benfavre / PinchZoomPan.js
Created February 17, 2018 22:53 — forked from iammerrick/PinchZoomPan.js
React Pinch + Zoom + Pan
import React from 'react';
const MIN_SCALE = 1;
const MAX_SCALE = 4;
const SETTLE_RANGE = 0.001;
const ADDITIONAL_LIMIT = 0.2;
const DOUBLE_TAP_THRESHOLD = 300;
const ANIMATION_SPEED = 0.04;
const RESET_ANIMATION_SPEED = 0.08;
const INITIAL_X = 0;
@benfavre
benfavre / drush_admin_create
Created September 22, 2017 15:03 — forked from ecorson/drush_admin_create
Add admin user via Drush
drush user-create adminuser --mail="adminuser@uiowa.edu" --password="UserPw"; drush user-add-role "administrator" adminuser