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
# It'll append the hosts file with an argument you | |
# send to it. | |
# | |
# For example, if you open 'cmd.exe' and go where this | |
# script is located: | |
# | |
# C:\Users\you> ruby add-host.rb "127.0.0.1 some-website.com" | |
# | |
# Your hosts file will have '127.0.0.1 some-website.com' at | |
# the 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
# This is where it all starts and ends | |
begin | |
# It saves all the lines of the file inside | |
# the 'contents' variable. | |
# Note that we use '/' as the path separator | |
# (and not '\') | |
contents = File.read("C:/Windows/system32/drivers/etc/hosts") | |
# We're going through each line of 'contents', | |
# assigning one at a time to the 'line' variable. |
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 <Flow/InputManager.hpp> | |
#include <Interface/Ncurses.hpp> | |
#include <ncurses.h> | |
int InputManager::pressedKey = ERR; // Starting with blank value | |
std::map<std::string, int> InputManager::binds; | |
void InputManager::bind(std::string name, int key) | |
{ |
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 | |
# | |
# Goes through every file under this directory, | |
# fixing it's `#include` statement. | |
# | |
# * Gets a file name by looking at the last | |
# path component of a `#include` | |
# * Searches for it under this directory tree | |
# * If found, inserts it's new relative path | |
# * If not, simply prints the output. |
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 gcd (int a, int b) | |
{ | |
if (b == 0) | |
return a; | |
if (a > b) | |
{ | |
int x = a; | |
a = b; | |
b = x; | |
} |
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
# Keep repeating words that contains 'fuck' until interrupted | |
yes `grep fuck /usr/share/dict/words` | tr '\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/bash | |
# This file signs several GPG keys, outputting | |
# each result on a different file. | |
MY_KEY=12345678 | |
KEYS="90123456 78901234 56789012 34567890" | |
for key in $KEYS | |
do | |
gpg --sign-key $key |
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/bash | |
# Gets the archived zipball of a GitHub repository | |
# $1 user | |
# $2 repo | |
LINK="https://github.com/$1/$2/archive/master.zip" | |
ZIPFILE="$2.zip" | |
echo "Downloading project '$2' from GitHub user '$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
#!/usr/bin/env ruby | |
# | |
# pipes.rb: Displays a nice animation on the terminal, | |
# based on an old screensaver. | |
# | |
# If you want to see some action, scroll to the bottom. | |
# The main code is between "begin" and "end". | |
# | |
# This code uses Ruby and it's Curses module to display | |
# characters on the terminal. |
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
require 'curses' | |
# Hell yeah | |
DANI_NUMERO_CIRCULOS = 4 | |
DANI_LIMPAR_TELA = false | |
# All possible colors. | |
Colors = { |
OlderNewer