Skip to content

Instantly share code, notes, and snippets.

View djaney's full-sized avatar

Djane Rey Mabelin djaney

  • Arcanys, Inc.
  • Philippines
View GitHub Profile
@djaney
djaney / mu-install.py
Created December 8, 2014 02:39
Force install a WordPress MU Plugin to all WHM accounts with wordpress installed
#!/usr/bin/python
import glob
import os
import shutil
def main():
filename = 'syncglobal.php'
path = '/home/*/public_html/wp-content'
for dirpath in glob.glob(path):
@djaney
djaney / bench.py
Last active August 29, 2015 14:11
CPU simple benchmark
#!/usr/local/bin/python3.4
import math
import time
def worker():
x = 0
@djaney
djaney / media_log.py
Last active August 29, 2015 14:11
Search Media
#!/usr/local/bin/python3.4
import string
import os
import re
import sys
import atexit
import base64
if os.name=='nt':
from ctypes import windll
@djaney
djaney / scan_sites.py
Last active August 29, 2015 14:12
Accepts csv from WHM account list and checks if the websites are down. or pipe from cat /etc/localdomains
#!/usr/bin/env python
import csv
import sys
import urllib2
import time
import socket
import threading
import os
@djaney
djaney / check_sheet_exam.gs
Created January 20, 2015 10:18
Reads all Form Result and check if it matches the values in the sheet called Answers
/**
* Reads all Form Result and check if it matches the values in the sheet called Answers
* After a successful evaluation, results sheet is created
*/
// SETTINGS
var QUESTION_COLUMN_START = 2;
var QUESTION_COUNT = 16;
// NO NEED TO EDIT BEYON THIS POINT, OR SO I THOUGHT...
#!/bin/bash
#ver. 2
##this script will check mysql and apache
##if that service is not running
##it will start the service and send
##an email to you
##set your email address
EMAIL="xxxxxxxxxxxx"
@djaney
djaney / Readme.md
Last active August 29, 2015 14:18
Symfony Box
  1. install cygwin with rsync component
  2. vagrant init
  3. vagrant up inside vagrant dir
  4. vagrant rsync-auto to watch files (somehow it won't autosync :/ )
  5. vagrant ssh
@djaney
djaney / TaskEventListener.php
Last active August 29, 2015 14:24
Symfony2 soft delete
<?php namespace Arcanys\TrainingBundle\EventListener;
use Doctrine\Common\EventSubscriber;
use Doctrine\ORM\Event\LifecycleEventArgs;
use Doctrine\ORM\Events;
use Arcanys\TrainingBundle\Entity\Task;
class TaskEventListener implements EventSubscriber{
public function getSubscribedEvents()
angular.module('ngSocialMedia',[])
.directive('fbShare',function($window){
var fbShare = function(url, winWidth, winHeight) {
url = url || $window.location.href;
winWidth = winWidth || 520;
winHeight = winHeight || 350;
@djaney
djaney / ExactResizer.php
Last active September 21, 2015 02:20
Symfony2 sonata media bundle custom re-sizer that does not lose the image ratio.
<?php namespace Application\Sonata\MediaBundle\Resizer;
use Imagine\Image\ImagineInterface;
use Imagine\Image\Box;
use Gaufrette\File;
use Sonata\MediaBundle\Model\MediaInterface;
use Sonata\MediaBundle\Resizer\ResizerInterface;
use Imagine\Image\ImageInterface;
use Imagine\Image\Point;
use Imagine\Exception\InvalidArgumentException;