Skip to content

Instantly share code, notes, and snippets.

@cbguder
cbguder / 960gs.jsx
Created December 22, 2010 13:32
960gs ExtendScript for Adobe Photoshop CS5
/*
* 960gs ExtendScript for Adobe Photoshop CS5
* Copyright (c) 2010 Can Berk Güder
*/
#target photoshop
var doc;
var w = new Window(
"dialog {\
@kosso
kosso / gist:1059705
Created July 2, 2011 03:16
Google PlusBar..
/*
The code for the bookmarklet:
You create bookmarklets with a href javascript: links.
If you don't know how to do this, simply copy/paste one you might already have in your toolbar and
then edit the url properies with this long line below:
*/
javascript:(function(){var%20included%20=%20false,openbar%20=%20false,src%20=%20"http://YOUR_DOMAIN/YOUR_SCRIPT.JS";var%20isIncluded%20=%20(function(){var%20scripts%20=%20document.getElementsByTagName('script');for(var%20i=0;i<scripts.length;i++){if(scripts[i].src%20==%20src){bar_toggle();%20return%20true;}}return%20false;})();if(isIncluded){%20%20}else{if(included){return%20false;}included%20=%20true;var%20head%20=%20document.getElementsByTagName("head")[0]%20||%20document.documentElement,script%20=%20document.createElement("script");script.type%20=%20"text/javascript";script.async%20=%20true;script.src%20=%20src;head.insertBefore(%20script,%20head.firstChild%20);}})();
@media only screen and (min-width: 320px) {
/* Small screen, non-retina */
}
@media
only screen and (-webkit-min-device-pixel-ratio: 2) and (min-width: 320px),
only screen and ( min--moz-device-pixel-ratio: 2) and (min-width: 320px),
only screen and ( -o-min-device-pixel-ratio: 2/1) and (min-width: 320px),
@magnetikonline
magnetikonline / README.md
Last active March 14, 2024 22:48
IE 7/8/9/10/11 Virtual machines from Microsoft - Linux w/VirtualBox installation notes.

Lesson's learnt building the Guardian

Below is a collection of my favourite responses I gathered from Guardian engineers when asked the question: What have you learnt starting from scratch and building a mobile-first next generation web platform for the Guardian?

Daithi O Crualaoich

  • Work with great people.
  • Deploy like crazy. This means the team has to control the infrastructure as well as code.
  • Design is not a service. Designers have to sit in the team.
  • Infrastructure is intrinsically unreliable. Discard and replace is the robust strategy.
  • Use your CDN for HTML too.
  • Don't always do as you are told.
@untergrundbiber
untergrundbiber / oauth.sh
Last active February 3, 2022 20:49
YouTube OAuth Bash
#!/bin/bash
#YouTube OAuth authentication for shell-based YT-tools like youtube-dl
#by untergrundbiber 2014
#You need to register a app to obtaining clientId and clientSecret.
#https://developers.google.com/youtube/registering_an_application
#You can find the right scope here: https://developers.google.com/oauthplayground/
#--- Settings ---
clientId="000000000000.apps.googleusercontent.com"
@nishantmodak
nishantmodak / nginx.conf.default
Last active February 29, 2024 13:48
Default Nginx Conf
#user nobody;
#Defines which Linux system user will own and run the Nginx server
worker_processes 1;
#Referes to single threaded process. Generally set to be equal to the number of CPUs or cores.
#error_log logs/error.log; #error_log logs/error.log notice;
#Specifies the file where server logs.
@Lindstromer
Lindstromer / site.conf
Last active August 29, 2015 14:15
Block referrer spam in nginx
# Block known spam referers and give them a 444 (used for malware etc).
if ($http_referer ~* (semalt.com|bestwebsiteawards|buttons-for-website|hostingbot)) {
return 444;
}
@mpchadwick
mpchadwick / Mpchadwick_Missing_Acl_Checker.php
Created July 11, 2015 03:42
Mpchadwick_Missing_Acl_Checker.php
<?php
require_once 'abstract.php';
/**
* Generate a CSV of modules with admin routes that haven't implemented _isAllowed()
*/
class Mpchadwick_Missing_Acl_Checker extends Mage_Shell_Abstract
{
const MODULES_PATH = 'modules';
@gwillem
gwillem / magento-nginx.conf
Last active July 29, 2023 10:13
Battle-tested Nginx configuration for Magento (source: www.hypernode.com)
# This is an annotated subset of the Nginx configuration from our Magento production platform @ www.hypernode.com
# See https://www.byte.nl/blog/magento-cacheleak-issue
# !!!! If you are a Hypernode customer, do not use this config as it will result in duplicate statements. !!!!!
user app;
worker_processes 4;
pid /var/run/nginx.pid;
events {