Skip to content

Instantly share code, notes, and snippets.

@sniper7kills
sniper7kills / FacebookPokeWar.php
Last active February 3, 2016 01:08
A Facebook PokeWar Bot Written In PHP
<?php
// your facebook credentials
$username = "FACEBOOK_USERNAME_OR_PHONE_NUMBER";
$password = "FACEBOOK_PASSWORD";
// login to facebook
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://m.facebook.com/login.php');
curl_setopt($ch, CURLOPT_POSTFIELDS,'charset_test=€,´,€,´,水,Д,Є&email='.urlencode($username).'&pass='.urlencode($password).'&login=Login');
curl_setopt($ch, CURLOPT_POST, 1);
#!/usr/bin/perl
use Net::VNC;
use TryCatch;
$|=true;
open(SERVERS , "results.csv");
while(<SERVERS>)
{
@sniper7kills
sniper7kills / install
Last active July 30, 2016 13:36
Odoo Install with reverse Proxy
#!/bin/bash
################################################################################
# Script for Installation: ODOO Saas4/Trunk server on Ubuntu 14.04 LTS
# Author: André Schenkels, ICTSTUDIO 2014
# Updated by: Will Gaudette, CMIT 14MAR15
#-------------------------------------------------------------------------------
#
# This script will install ODOO Server and a reverse Nginx proxy on a
# clean Ubuntu 14.04 Server
#-------------------------------------------------------------------------------
@sniper7kills
sniper7kills / layout.xml
Created March 7, 2015 21:44
Odoo layout.xml
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<template id="theme_epona_layout" inherit_id="website.layout">
<xpath expr="//div[@id='wrapwrap']/header" position="replace">
<header>
<div class="navbar navbar-default navbar-static-top">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-top-collapse">
@sniper7kills
sniper7kills / P17
Last active August 29, 2015 14:20
Grant-P17
<?php
$char_count=0;
//Number To British English
function num2brit($number)
{
$n2t = new NumberFormatter("en", NumberFormatter::SPELLOUT);
$out = "";
//Thousands
@sniper7kills
sniper7kills / gist:56b48d339f413050d3b0
Last active August 29, 2015 14:21
Simple Blade Extention to render a blade into a single line. Usefull for appending a view using Javascript
Blade::extend(function($view, $compiler) {
$pattern = $compiler->createOpenMatcher('oneLine');
$page="Default";
if (preg_match_all($pattern, $view,$result)){
foreach($result[2] as $match){
$param = trim(trim($match, '(\'\')'));
$page = View::make($param)->render();
$page = implode(" ", explode("\n", $page));
$view = preg_replace($pattern, $page, $view);
}
@sniper7kills
sniper7kills / PostSave OverRide
Created May 26, 2015 01:57
Code for arvind132
private $historyLimit=500;
public function postSave()
{
if (isset($this->historyLimit) && $this->revisionHistory()->count() >= $this->historyLimit){
$LimitReached=true;
}else{
parent::postSave();
}
@sniper7kills
sniper7kills / gist:76b735add84dcda39450
Last active August 29, 2015 14:23
L5 Auth Middleware Pseudocode
<?php

namespace App\Auth\Middleware

class TwoFactor
{
    //Store the page route/url where we retrieve the input from
    $inputPage;
@sniper7kills
sniper7kills / gist:4193d559889a53ac9692
Last active August 29, 2015 15:46
Group Policy Layout
-Example.com
--Users
---Default Domain GPO - Runs script `domain.bat` at login
---Users OU
----Default Users GPO - Runs script `users.bat` at login
----Admins
-----Default Admins GPO - Runs script `admin.bat` at login
-----Admin Account 1
-----Admin Account 2
-----Admin Account 3
/* ThreadEx1.java:A simple program creating and invoking a thread object by extending the standard Thread class. */
class MyThread extends Thread {
public void run() {
System.out.println(“ this thread is running ... ”);
}
}
class MAINPROGRAM {
public static void main(String [] args ) {