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
#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/bash | |
# | |
# wget-all: gets all files from a specified file extension | |
# on a remote host | |
function usage() { | |
echo 'Usage:' | |
echo ' $ wget-all.sh <remote-host> <filename-extension>' | |
echo | |
echo 'Example:' |
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
Private Sub CommandButton1_Click() | |
Dim cpfs As Range | |
Set cpfs = ThisWorkbook.Worksheets("pdf").Range("B3:B169") | |
Dim cpf As Range | |
Dim new_cpfs As Range | |
Set new_cpfs = ThisWorkbook.Worksheets("09").Range("C2:C194") |
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
-- Autoscroll script for luakit (luakit.org). | |
-- Originally by @mason-larobina | |
-- (https://gist.github.com/mason-larobina/726550) | |
-- | |
-- Install instructions: | |
-- * Add to rc.lua before window spawning code | |
-- Or | |
-- * Save to $XDG_CONFIG_HOME/luakit/autoscroll.lua and | |
-- add `require "autoscroll"` to your rc.lua | |
---------------------------------------------------------------- |
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
;; My first IA-32 program! | |
;; | |
;; It shows "Hello, World" and exits normally | |
section .data | |
msg db "Hello, World!", 0xA ; Message to show | |
size EQU $ - msg ; Length of the message | |
global _starting_here ; Global entry for `ld` |
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 | |
# | |
# A test on fractals, implementing The Chaos Game | |
# http://math.bu.edu/DYSYS/chaos-game/node1.html | |
# | |
# UGLY CODE IS UGLY | |
require 'sdl' | |
# Global SDL screen pointer |
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 | |
# | |
# Gets problems from the UVa website, in order of solvability. | |
# | |
# Sample page: | |
# http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=3 | |
require 'nokogiri' | |
require 'open-uri' |
NewerOlder