This file contains hidden or 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
{ | |
"client": { | |
"grants": [ | |
{ | |
"scopes": [{}] | |
} | |
], | |
"sessions": [ | |
{ | |
"authcodes": [ |
This file contains hidden or 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 Event < ActiveRecord::Base | |
self.table_name = "events_event" | |
has_and_belongs_to_many :artists, { :join_table => "events_event_artists" } | |
attr_accessor :localized_date, :month | |
def localized_date | |
I18n.localize(read_attribute(:date), :format => "%d %b") | |
end | |
def month |
This file contains hidden or 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 Event < ActiveRecord::Base | |
self.table_name = "events_event" | |
has_and_belongs_to_many :artists, { :join_table => "events_event_artists" } | |
attr_accessor :localized_date | |
def localized_date=(date) | |
write_attribute(:date, I18n.localize(date, :format => "%b")) | |
end | |
def localized_date |
This file contains hidden or 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
09:26:54 User: I'm being so sincere right now. | |
09:26:59 Cleverbot: Even though you broke my heart and killed me. | |
09:27:29 User: And tore me to pieces. | |
09:27:33 Cleverbot: And threw every piece into a fire. | |
09:27:56 User: As they burned it hurt because I was so happy for you! | |
09:28:01 Cleverbot: Now these points of data make a beautiful line. | |
09:28:21 User: And we're out of beta, we're releasing on time! | |
09:28:25 Cleverbot: So I'm glad I got burned, think of all the things we learned. | |
09:28:58 User: For the people that are still alive. | |
09:29:05 Cleverbot: Go ahead and leave me. |
This file contains hidden or 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 Kitten | |
{ | |
string Colour = String.Empty; // Colour of kitten. | |
/* The "default" value of a string is null, NOT an empty string. | |
If this is a value that won't always be set, we should declare it as an empty string. */ | |
string Name = String.Empty; | |
int Age; // Age in months. | |
bool Fluffy; // Whether or not kitten is fluffy. |
This file contains hidden or 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 | |
if(isset($_GET['url'])) { | |
if(!isset($_GET['type'])) { | |
die(); | |
} | |
$page = file_get_contents(urldecode($_GET['url'])); | |
if($_GET['type'] == "lesson") { | |
preg_match('#href="(.*?)">Download video#',$page,$link); | |
preg_match("#<div class=\"entry-content\">(.*?)<\/div>#usm",$page,$content); | |
/* print $link[0]; */ |
This file contains hidden or 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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading; | |
namespace Uppgifter3 | |
{ | |
class Program | |
{ |
This file contains hidden or 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 if(isset($_GET["fuckit"])) { // Remove the data file and redirect | |
unlink("data"); | |
header("Location: ./1.php"); | |
} | |
?> | |
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8" /> |
This file contains hidden or 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 | |
function ocr($str) { | |
$counts = array_filter(count_chars($str)); | |
// Length of string divided by length of character count array | |
// gives us the average occurences of each character | |
$avg_occurences = strlen($str) / count($counts); | |
foreach($counts as $char => $count) { |
This file contains hidden or 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
SELECT (IFNULL(l.links,0)+IFNULL(c.comments,0)) AS points FROM | |
(SELECT users.id AS id, sum(v.vote) as links FROM users | |
LEFT JOIN links ON links.user=users.id | |
LEFT JOIN votes as v ON v.subjectid=links.id AND v.type='link' GROUP BY id) as l | |
JOIN (SELECT users.id AS id, sum(v.vote) as comments FROM users | |
LEFT JOIN comments ON comments.userid=users.id | |
LEFT JOIN votes as v ON v.subjectid=comments.id AND v.type='comment' GROUP BY id) as c | |
ON l.id=c.id WHERE c.id=$userid GROUP BY c.id"; |
NewerOlder