Skip to content

Instantly share code, notes, and snippets.

View dgrammatiko's full-sized avatar
💭
👀 4 my next gig

Dimitris Grammatikogiannis dgrammatiko

💭
👀 4 my next gig
View GitHub Profile
<!-- to be saved at /usr/share/nginx/html/404.html -->
<html lang="en"><head><meta charset="utf-8">
<meta name="viewport" content="initial-scale=1, minimum-scale=1, width=device-width">
<title>Error 404 (Not Found)!!1</title>
<style>
*{margin:0;padding:0}html,code{font:15px/22px arial,sans-serif}html{background:#fff;color:#222;padding:15px}body{margin:7% auto 0;max-width:390px;min-height:180px;padding:30px 0 15px}* > body{background:url(//www.google.com/images/errors/robot.png) 100% 5px no-repeat;padding-right:205px}p{margin:11px 0 22px;overflow:hidden}ins{color:#777;text-decoration:none}a img{border:0}@media screen and (max-width:772px){body{background:none;margin-top:0;max-width:none;padding-right:0}}
</style>
<link type="text/css" rel="stylesheet" href="chrome-extension://cpngackimfmofbokmjmljamhdncknpmg/style.css"><script type="text/javascript" charset="utf-8" src="chrome-extension://cpngackimfmofbokmjmljamhdncknpmg/page_context.js"></script></head><body screen_capture_injected="true">
<!--
@dgrammatiko
dgrammatiko / index.php
Created June 21, 2014 11:55
Cookie control for Joomla! administrator area
<?php
define('_JEXEC', 1);
$admin_cookie_code="CODE_HERE";
//setcookie("AdminSession",$admin_cookie_code,0,"/"); $_SERVER['HTTP_HOST']
setcookie("AdminSession", $admin_cookie_code, 0,"/administrator/", $_SERVER['HTTP_HOST'], false);
header("Location: ../administrator/index.php");
//administrator/index.php
if (!isset($_COOKIE['AdminSession']) or $_COOKIE['AdminSession']!='213')
{
/*! = $rembase: 14px
--------------------------------------------------------------
* hmtl { font-size: 87.5%; }
* body { font-size: 14px; font-size: 1rem; line-height: 1; }
* 4px 0.28571429rem
* 8px 0.571428571rem
* 12px 0.857142857rem
* 13px 0.928571429rem
* 14px 1rem
* 16px 1.142857143rem
@dgrammatiko
dgrammatiko / nginx.conf
Last active August 29, 2015 14:16 — forked from thoop/nginx.conf
# Change YOUR_TOKEN to your prerender token and uncomment that line if you want to cache urls and view crawl stats
# Change example.com (server_name) to your website url
# Change /path/to/your/root to the correct value
server {
listen 80;
server_name example.com;
root /path/to/your/root;
index index.html;

OS X Preferences


#Disable window animations
defaults write NSGlobalDomain NSAutomaticWindowAnimationsEnabled -bool false

#Enable repeat on keydown
defaults write -g ApplePressAndHoldEnabled -bool false
(function() {
var CSSCriticalPath = function(w, d, opts) {
var opt = opts || {};
var css = {};
var pushCSS = function(r) {
if(!!css[r.selectorText] === false) css[r.selectorText] = {};
var styles = r.style.cssText.split(/;(?![A-Za-z0-9])/);
for(var i = 0; i < styles.length; i++) {
if(!!styles[i] === false) continue;
var pair = styles[i].split(": ");
<!DOCTYPE html>
<!-- This is the shortest Image Uploader ever :)
And you can even make it shorter if you don't
want all the drag'n drop thing. -->
<!--
AUTHOR: @paulrouget <paul@mozilla.com>
LICENSE:
@dgrammatiko
dgrammatiko / desc.xml
Created April 7, 2016 20:03
Insert the part from desc.xml to the module/plugin/template xml and create a folder field and copy the file testing.php inside it
<field name="testone" class="" type="testone" default="0"
label="test one"
description="test one" />
@dgrammatiko
dgrammatiko / plugin.min.js
Last active April 23, 2016 08:44
JSON.stringify drag and drop
tinymce.PluginManager.add('jdragdrop', function(editor) {
// Reset the drop area border
tinyMCE.DOM.bind(document, 'dragleave', function(e) {
e.stopPropagation();
e.preventDefault();
tinyMCE.activeEditor.contentAreaContainer.style.borderWidth='';
return false;
});
/* calendar-lang.js*/
// Calendar._DN = new Array("یکشنبه", "دوشنبه", "سه شنبه", "چهارشنبه", "پنجشنبه", "جمعه", "شنبه", "یکشنبه");
// Calendar._SDN = new Array("یک", "دو", "سه", "چهار", "پنج", "جمعه", "شنبه", "یک");
// Calendar._FD = 6;
// Calendar._MN = new Array("ژانویه", "فوریه", "مارس", "آوریل", "می", "جون", "جولای", "آگوست", "سپتامبر", "اکتبر", "نوامبر", "دسامبر");
// Calendar._SMN = new Array("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec");
// Calendar._JMN = new Array("فروردین", "اردیبهشت", "خرداد", "تیر", "مرداد", "شهریور", "مهر", "آبان", "آذر", "دی", "بهمن", "اسفند");
// Calendar._JSMN = new Array("فروردین", "اردیبهشت", "خرداد", "تیر", "مرداد", "شهریور", "مهر", "آبان", "آذر", "دی", "بهمن", "اسفند");
// Calendar._TT = {};