Skip to content

Instantly share code, notes, and snippets.

View sayak-sarkar's full-sized avatar
🏠
Working from home

Sayak Sarkar sayak-sarkar

🏠
Working from home
View GitHub Profile
@sayak-sarkar
sayak-sarkar / gist:2210590
Created March 26, 2012 23:24
BDD for SilverStripe sample
# features/log-in.feature
Feature: Create a page
As an site owner
I want to access to the CMS to be secure
So that only my team can make content changes
Scenario: Bad login
When I log in with "[email protected]" and "badpassword"
Then I will see a bad log-in message
And if I visit admin
<!DOCTYPE html><html><head>
<title>My Music - Credits</title>
</head>
<body>
<p></p>
</body></html>
<!DOCTYPE html>
<html lang="en">
<head>
<base href="https://popcorn.webmaker.org/templates/basic/">
<title>Popcorn Maker</title>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width">
<link rel="stylesheet" href="style.css">
@sayak-sarkar
sayak-sarkar / sublime-text-2.sh
Last active April 29, 2021 16:41 — forked from henriquemoody/sublime-text-2.sh
Gist updated to Sublime Text v2.0.2, 64bit
# Adapted from https://gist.github.com/henriquemoody/3288681
#!/bin/sh
SHORTCUT="[Desktop Entry]
Name=Sublime Text 2
Comment=Edit text files
Exec=/usr/local/sublime-text-2/sublime_text
Icon=/usr/local/sublime-text-2/Icon/128x128/sublime_text.png
Terminal=false
Type=Application
Clone the repositories:
git clone git://git.yoctoproject.org/poky
cd poky
git clone git://git.yoctoproject.org/meta-raspberrypi
git clone git://git.openembedded.org/meta-openembedded
git clone git://github.com/imphil/meta-b2g.git
. ./oe-init-build-env rpi-build
Traverse into 'conf' directory
// Remap $ to jQuery object
var $ = jQuery;
// The real fun begins... first catch all the post-anchors & loop on them
$(".badge-evt.badge-nsfw-entry-cover").each(function () {
// Find out the ID of the post
var id = ($(this).attr("href").split("/"))[4];
// Construct the `quite guessable` image URL
var url = "http://d3dsacqprgcsqh.cloudfront.net/photo/" + id + "_460s.jpg";
// Put in an image element with source as the formed URL
app.use(express.methodOverride());
// ## CORS middleware
//
// see: http://stackoverflow.com/questions/7067966/how-to-allow-cors-in-express-nodejs
var allowCrossDomain = function(req, res, next) {
res.header('Access-Control-Allow-Origin', '*');
res.header('Access-Control-Allow-Methods', 'GET,PUT,POST,DELETE');
res.header('Access-Control-Allow-Headers', 'Content-Type, Authorization');