Skip to content

Instantly share code, notes, and snippets.

View adalenv's full-sized avatar
🌐
Worldwide

Adalen Vladi adalenv

🌐
Worldwide
View GitHub Profile
@adalenv
adalenv / vici_install.md
Created June 9, 2017 08:41 — forked from identor/vici_install.md
Guide: Vici Dial Installation

Vici Dial Installation Guide

This guide shows a simple Vici Dial installtion on a debian6_x64 droplet in Digital Ocean.

Create the Droplet

General Guidelines:

  • Create the Droplet by selecting Create Droplet in the Droplet's UI.
  • Select the 64 bit image of debian 6.

Dependency installation

We need to install all dependencies before proceeding to install the astguiclient.

$(document).ready(function() {
var offset=250, // At what pixels show Back to Top Button
scrollDuration=300; // Duration of scrolling to top
$(window).scroll(function() {
if ($(this).scrollTop() > offset) {
$('.top').fadeIn(500); // Time(in Milliseconds) of appearing of the Button when scrolling down.
} else {
$('.top').fadeOut(500); // Time(in Milliseconds) of disappearing of Button when scrolling up.
}
});
@adalenv
adalenv / facebook_leads.md
Created August 10, 2017 15:42 — forked from tixastronauta/facebook_leads.md
Receiving Facebook Leads on a Webhook

Receiving Facebook Leads on a Webhook

1 - Create an App

Head over to developer.facebook.com and create an App

2 - Setup the webhook

On your server, create a facebook webhook that will handle facebook calls. Then create a "leadgen" webhook on you App: https://developers.facebook.com/docs/graph-api/webhooks/v2.5

@adalenv
adalenv / encode_decode.php
Created October 26, 2017 21:59 — forked from LogIN-/encode_decode.php
PHP custom encode decode functions
<?php
function encode($string,$key) {
$key = sha1($key);
$strLen = strlen($string);
$keyLen = strlen($key);
for ($i = 0; $i < $strLen; $i++) {
$ordStr = ord(substr($string,$i,1));
if ($j == $keyLen) { $j = 0; }
$ordKey = ord(substr($key,$j,1));
$j++;
=IF(LEN(C1)>10,RIGHT(C1, LEN(C1)-2),C1) //remove first two chars if lengh> 10
=RIGHT(A1, LEN(A1)-2) //remove first two characters
=CONCATENATE(A1," ",B1) //merge cells
=LEN() //get length
@adalenv
adalenv / pdocrash.php
Created February 28, 2018 15:48 — forked from bradtraversy/pdocrash.php
PDO & Prepared Statements Snippets
<?php
$host = 'localhost';
$user = 'root';
$password = '123456';
$dbname = 'pdoposts';
// Set DSN
$dsn = 'mysql:host='. $host .';dbname='. $dbname;
// Create a PDO instance
@adalenv
adalenv / vzrebootall.sh
Last active April 6, 2018 09:05
Reboot All Containers (OpenVZ)
for VE in $(vzlist -Ha -o veid); do vzctl restart $VE; done
@adalenv
adalenv / uncommitLastCommit.md
Created April 12, 2018 10:01 — forked from alexislucena/uncommitLastCommit.md
Git: How to uncommit my last commit in git

To keep the changes from the commit you want to undo

$ git reset --soft HEAD^

To destroy the changes from the commit you want to undo

$ git reset --hard HEAD^

You can also say

@adalenv
adalenv / phone_nr.py
Created May 22, 2018 15:20
Phone Number Scraper
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
# Created on 2018-05-18 09:33:05
# Project: test1
from pyspider.libs.base_handler import *
class Handler(BaseHandler):
crawl_config = {
FOR BUILD 3176
----- BEGIN LICENSE -----
sgbteam
Single User License
EA7E-1153259
8891CBB9 F1513E4F 1A3405C1 A865D53F
115F202E 7B91AB2D 0D2A40ED 352B269B
76E84F0B CD69BFC7 59F2DFEF E267328F
215652A3 E88F9D8F 4C38E3BA 5B2DAAE4