Skip to content

Instantly share code, notes, and snippets.

View clauswitt's full-sized avatar

Claus Witt clauswitt

View GitHub Profile
var fs = require('fs');
fs.writeFile("file.txt", "This is the new file content.", function(err) {
if(err) {
return console.log(err);
}
console.log("The file was saved!");
});
@clauswitt
clauswitt / TEMPLATE.glsl
Created January 15, 2016 07:31 — forked from glslioadmin/TEMPLATE.glsl
GLSL.io Transition (v1)
#ifdef GL_ES
precision highp float;
#endif
// General parameters
uniform sampler2D from;
uniform sampler2D to;
uniform float progress;
uniform vec2 resolution;
Array.apply(null, Array(1000)).map(function (_, i) {return i;}).reduce(function(sum, cur) {if(cur%3==0 || cur%5==0)sum+=cur;return sum});
<?php
file_put_contents("outfile.txt", "This is a string, but it could have been an array or a stream as well");
import Data.Char
main :: IO ()
main = do
inp <- getContents
let ls = lines inp
mapM_ putStrLn ls
import System.IO
main = myLoop
myLoop = do done <- isEOF
if done
then putStrLn ""
else do inp <- getLine
putStrLn inp
myLoop
#include <iostream>
#include <string>
int main(int argc, char** argv)
{
std::string line;
int counter = 0;
while (std::getline(std::cin, line)) {
counter++;
std::cout << counter << ": " << line << "\n";
#include<stdlib.h>
#include<stdio.h>
main() {
FILE *f = fopen("file.txt", "w");
if (f == NULL)
{
printf("Error opening file!\n");
exit(1);
}
fs = require('fs')
fs.readFile('file.js', 'utf8', function (err,data) {
if (err) {
return console.log(err);
}
console.log(data);
});
package main
import (
"bufio"
"fmt"
"log"
"os"
)
func readLines(path string) ([]string, error) {