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
package main | |
import ( | |
"bufio" | |
"fmt" | |
"os" | |
) | |
func ReadFileLines(filePath string) []string { | |
f, err := os.Open(filePath) |
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
package main | |
import ( | |
"bufio" | |
"fmt" | |
"os" | |
"strings" | |
) | |
func ReadStringLines(s string) []string { |
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 | |
$filename = !empty($_GET["filename"]) ? $_GET["filename"] : null; | |
if ($filename) { | |
$chunk = file_get_contents("php://input"); | |
file_put_contents($filename, $chunk, FILE_APPEND); | |
} | |
?> |
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
/** | |
* For compiling program run: | |
* gcc -std=c99 color_output.c -o color_output.run | |
*/ | |
#include <stdio.h> | |
#define ANSI_RESET_ALL "\x1b[0m" | |
#define ANSI_COLOR_BLACK "\x1b[30m" | |
#define ANSI_COLOR_RED "\x1b[31m" |
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
/** | |
* For compiling program run: | |
* gcc -std=c99 window_list.c -o window_list.run | |
*/ | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#define ANSI_COLOR_GREEN "\x1b[32m" | |
#define ANSI_COLOR_RESET "\x1b[0m" |
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
## Add in Gemfile | |
group :development, :test do | |
# ... | |
gem 'rspec-rails' | |
gem 'factory_girl_rails' | |
end | |
group :test do | |
gem 'shoulda-matchers', '~> 3.0' | |
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
PROJECT=start | |
rbenv gemset init $PROJECT | |
rbenv gemset active | |
gem install rails | |
rails new $PROJECT -d postgresql | |
# config/database.yml |
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
window.addEventListener('load', function () { | |
'use strict'; | |
var images = document.querySelectorAll("img[src$='.svg'"); | |
var len = images.length; | |
for (var i = 0; i < len; i++) { | |
var img = images[i]; | |
svgFromIMG(img); | |
} |
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
sudo yum install libmpc-devel mpfr-devel gmp-devel | |
cd ~/Downloads | |
curl ftp://ftp.mirrorservice.org/sites/sourceware.org/pub/gcc/releases/gcc-4.9.2/gcc-4.9.2.tar.bz2 -O | |
tar xvfj gcc-4.9.2.tar.bz2 | |
cd gcc-4.9.2 | |
./configure --disable-multilib --enable-languages=c,c++ | |
make -j 4 | |
sudo make install |
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 | |
function __autoload($class) | |
{ | |
$parts = explode('\\', $class); | |
require end($parts) . '.php'; | |
} |