Skip to content

Instantly share code, notes, and snippets.

var gr = new GlideRecord('u_focus_group');
var strQuery = 'u_expiration>=javascript:gs.beginningOfToday()^u_active=true';
gr.addEncodedQuery(strQuery);
gr.query();
while (gr.next()) {
// Reset user profile and password
var gruser = new GlideRecord('sys_user');
gruser.get(gr.u_user);
@aenigme
aenigme / fullbackup.php
Created October 9, 2014 08:48
cPanel Backup Cronjob
Using the script* provided below you will be able to make automatic backup of your hosting account (domains and MySQL databases). This backup script includes SSL support. This is not necessary if you run the script on the server for which you are generating the backup; but the SSL support could be important if you are running the script somewhere else to connect to your cPanel hosting account.
<?php
// PHP script to allow periodic cPanel backups automatically, optionally to a remote FTP server.
// This script contains passwords. It is important to keep access to this file secure (we would ask you to place it in your home directory, not public_html)
// You need create 'backups' folder in your home directory ( or any other folder that you would like to store your backups in ).
@aenigme
aenigme / .htaccess
Created September 9, 2014 01:06
Perishable Press 5G Blacklist
# 5G BLACKLIST/FIREWALL (2013)
# @ http://perishablepress.com/5g-blacklist-2013/
# 5G:[QUERY STRINGS]
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{QUERY_STRING} (\"|%22).*(<|>|%3) [NC,OR]
RewriteCond %{QUERY_STRING} (javascript:).*(\;) [NC,OR]
RewriteCond %{QUERY_STRING} (<|%3C).*script.*(>|%3) [NC,OR]
RewriteCond %{QUERY_STRING} (\\|\.\./|`|=\'$|=%27$) [NC,OR]
@aenigme
aenigme / jquery.plugin.js
Created March 19, 2012 18:41
jQuery Boilerplate for plugins
// keep all your code in a closure
(function($)
{
// provide default settings
var defaultSettings = {
position : 'mouse',
color : 'black'
};
// name your plugin - try to make it unique
@aenigme
aenigme / .sync_things.yaml
Created November 15, 2011 08:57 — forked from awalker/sync_things.rb
Simple Ruby script to sync Basecamp and Things to-dos.
---
url: yoursubdomain.basecamphq.com
username: your_api_token
password: X
current_user: your_current_user_id (pull it out of your edit URL)
basecamp_project: your_project_id (in URL)
@aenigme
aenigme / .htaccess
Created October 1, 2010 20:38
301 redirect with match for htaccess
RedirectMatch 301 ^.*$ http://www.example.com/
@aenigme
aenigme / .htaccess
Created September 4, 2010 03:03
Kohana v2 .hatccess for Godaddy
# Turn on URL rewriting
RewriteEngine On
# Installation directory
RewriteBase /
# Protect application and system files from being viewed
RewriteRule ^(application|modules|system) - [F,L]
# Allow any files or directories that exist to be displayed directly
@aenigme
aenigme / MY_html.php
Created August 31, 2010 23:23
Extension for Kohana HTML helper
<?php defined('SYSPATH') or die('No direct script access.');
class html extends html_Core
{
/**
* Minify URI Builder
*
* @param string $href
* @param string $type
* @return string
@aenigme
aenigme / gradient.css
Created August 25, 2010 01:43
CSS3 Gradient Backgrounds
div.box {
-webkit-gradient(linear, left top, left bottom, from(red), to(white));
-moz-linear-gradient(red, white)
width: 480px;
height: 320px;
}
@aenigme
aenigme / git_buttons.html
Created August 24, 2010 04:07
Inspired by the navigation menu on Git. Includes a base64 background image.
<style>
ul.tabs {
-moz-border-radius:5px 5px 5px 5px;
-webkit-border-radius:5px 5px 5px 5px;
border:1px solid #DDDDDD;
height:26px;
margin:10px 0 0;
padding:6px 10px;
position:relative;
background:url(data:image/gif;base64,R0lGODlhVwAmAMQAAOjo6Nzc3OTk5OXl5eLi4t/f3+np6ebm5uPj4+Dg4O3t7erq6ufn5+Hh4d7e3uvr6+zs7N3d3QAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAAAAAAALAAAAABXACYAAAX/oCKOZGmeaKqubOu+cCyPUG3feK7vfO//wKBwSCwaj8jk7sFsOp/QqHRKrVqv2Kx2y+16v2DpYkwum8/otHrNbrvf8Lh8TjbY7/i8fs/v+/+AgYKDhIWGdwCJiouMjY6PkJGSk5AMlpeYmZqbnJ2en6ChoqOkpaaXB6mqq6ytrq+wsbKztLW2t7i5qgO8vb6/wMHCw8TFxsfIycrLzL0Cz9DR0tPU1dbX2NnWCNzd3t/g4eLj5OXm5+jp6uvs3QTv8PHy8/T19vf4+fr7/P3+//AaCBxIsKDBgwgTKlzIsKHDhxAjSpxIsaJFhAkyatzIsaPHjyBDihxJsqTJkyhTW2oswLKly5cwY8qcSbOmzZs4c+rcybOlg59AgwodSrSo0aNIkypdyrSp06dQo0qdWjSC1atYs2rdyrWr169gw4odS7as2bNo06rlGqCt27dw48qdS7eu3bt0QwAAOw==) repeat-x scroll 0 0 transparent;