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
// (c) 2011 detunized (http://detunized.net) | |
// Paste the shader below into http://www.iquilezles.org/apps/shadertoy/?p=deform | |
// Click and drag the mouse around | |
#ifdef GL_ES | |
precision highp float; | |
#endif | |
uniform vec2 resolution; | |
uniform vec4 mouse; |
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
global_variables.sort.each do |name| | |
puts "#{name}: #{eval "#{name}.inspect"}" | |
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
[[], [1], [2], [1, 2], [3], [1, 3], [2, 3], [1, 2, 3], [4], [1, 4], [2, 4], [1, 2, 4], [3, 4], [1, 3, 4], [2, 3, 4], [1, 2, 3, 4]] |
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
int main(int argc, char *argv[]) | |
{ | |
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_LOW, 0), ^(void) { | |
size_t const BUFFER_SIZE = 2048; | |
// Create a pipe | |
int pipe_in_out[2]; | |
if (pipe(pipe_in_out) == -1) | |
return; |
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
// A solution for http://www.geeksforgeeks.org/archives/25739 | |
// | |
// Given two numbers represented by two linked lists, write a function that | |
// returns sum list. The sum list is linked list representation of addition of | |
// two input numbers. It is not allowed to modify the lists. Also, not allowed | |
// to use explicit extra space (Hint: Use Recursion). | |
// | |
// Example: | |
// | |
// Input: |
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
#include <vector> | |
#include <limits> | |
#include <iostream> | |
struct Edge | |
{ | |
Edge(size_t to, int cost) | |
: to(to - 1) | |
, cost(cost) | |
{} |
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
#!/usr/bin/env ruby | |
class Coord | |
attr_reader :x, :y | |
def initialize x, y | |
@x = x | |
@y = y | |
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
#include <iostream> | |
#include <string> | |
#include <boost/type_traits/has_less.hpp> | |
#define HAS_LESS(type) (boost::has_less<type>::value \ | |
? #type ": has less" \ | |
: #type ": doesn't have less") | |
#define CHECK(type) (std::cout << HAS_LESS(type) << "\n") |
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
#!/bin/sh | |
ffmpeg -i input.mkv -c:v copy -c:a copy temporary-no-subtitles.mp4 | |
mp4box temporary-no-subtitles.mp4 -add subtitles-in-utf8.srt -out output.mp4 |
OlderNewer