This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once(dirname(__FILE__) . '/wp-load.php'); | |
require_once(dirname(__FILE__) . '/wp-includes/post.php'); | |
$args = array( | |
'numberposts' => 100, | |
'offset' => 0, | |
'orderby' => 'post_date', | |
'order' => 'DESC', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ApplicationController < ActionController::Base | |
protect_from_forgery | |
check_authorization :unless => :devise_controller? | |
unless Rails.application.config.consider_all_requests_local | |
rescue_from CanCan::AccessDenied, :with => :render_forbidden | |
end | |
private |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class SessionsController < Devise::SessionsController | |
def after_sign_in_path_for(resource) | |
if session[:post_auth_path] | |
url = session[:post_auth_path] | |
session[:post_auth_path] = nil | |
else | |
url = root_path | |
end | |
url | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
devise_for :users, :controllers => {:sessions => "sessions"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from urllib import urlopen | |
from BeautifulSoup import BeautifulSoup | |
import time | |
import os | |
c = 1; | |
while os.path.exists(os.path.join('images', str(c) + '.jpg')): | |
c = c + 1 | |
while True: | |
oldTime = time.time() | |
html = urlopen("http://www.usap.gov/videoclipsandmaps/mcmwebcam.cfm").read() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ffmpeg -r 24 -b 4000k -i images/%%d.jpg mcmurdo.mp4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -v -H "Accept: application/json" -H "Content-Type: application/json" -X PUT -d '{"user":{"name":"John Doe", "age":30}}' http://localhost:3000/users/1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -v -H "Accept: application/json" -X GET -d 'limit=10&offset=20' http://localhost:3000/users |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var sys = require('sys'); | |
var express = require('express'); | |
var io = require('socket.io'); | |
var app = express.createServer(express.staticProvider(__dirname + '/public')); | |
app.listen(8080); | |
var socket = io.listen(app); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> | |
<script src="/client/socket.io.js"></script> | |
<script> | |
$(document).ready(function() { | |
var socket = new io.Socket(null, {rememberTransport: false, port: 8080}); | |
socket.on('connect', function() { | |
socket.send('A client connected.'); |
OlderNewer