This file contains hidden or 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 <cstdlib> | |
| #include <algorithm> | |
| #define LEN 256 | |
| char* dec2bin(int dec); | |
| int main(int argc, char *argv[]) { | |
| if(argc != 2) { | |
| std::cout << "Input is required" << std::endl; |
This file contains hidden or 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 'superators19' | |
| class Range | |
| superator '>>+' do |something| | |
| [].tap { |ary| | |
| self.each { |i| | |
| ary << something.new | |
| } | |
| } | |
| end |
This file contains hidden or 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
| class Pokemon | |
| def initialize(&block) | |
| @var = [] | |
| instance_eval &block | |
| end | |
| def method_missing(m, *args, &block) | |
| if args.any? | |
| args = args.first if args.length == 1 | |
| @var << { m => args } |
This file contains hidden or 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
| class Dialogues | |
| def initialize(&block) | |
| @var = [] | |
| instance_eval &block | |
| end | |
| def method_missing(m, *args, &block) | |
| if args.any? | |
| args = args.first if args.length == 1 | |
| @var << { m => args } |
This file contains hidden or 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
| json: { | |
| name: Arnoldo, | |
| surname: di Guascogna, | |
| age: 58 | |
| } | |
| ws: charset reduce [space tab cr lf] | |
| letter: charset [#"a" - #"z" - #"A" - #"Z"] | |
| parse json tags: [ |
This file contains hidden or 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 | |
| ########################################### | |
| # | |
| alpha = { :a=>'._', :b=>'_...', # | |
| :c=>'_._.', :d=>'_..', # | |
| :e=>'.', :f=>'.._.', # | |
| :g=>'__.', :h=>'....', # | |
| :i=>'..', :j=>'.___', # | |
| :k=>'_._', :l=>'._..', # |
This file contains hidden or 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 'net/ftp' | |
| require 'fileutils' | |
| require 'clipboard' | |
| require 'bitly' | |
| require 'rubyfish' | |
| class String | |
| def fix | |
| gsub(/\\/, ?/).force_encoding('iso-8859-1').encode('utf-8') | |
| end |
This file contains hidden or 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
| ALTER TABLE episodes ALTER editing SET DEFAULT null; | |
| ALTER TABLE episodes | |
| ALTER editing TYPE smallint | |
| USING | |
| CASE | |
| WHEN editing THEN 2 else 1 | |
| END; | |
| ALTER TABLE episodes ALTER editing SET DEFAULT 1; |
This file contains hidden or 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 'benchmark' | |
| require 'observer' | |
| require 'alakazam' | |
| class Logger | |
| def update(*things) | |
| # | |
| end | |
| end |
This file contains hidden or 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 <stdio.h> | |
| #include <windows.h> | |
| HWND GetConsoleHwnd(void) | |
| { | |
| #define MY_BUFSIZE 1024 // Buffer size for console window titles. | |
| HWND hwndFound; // This is what is returned to the caller. | |
| char pszNewWindowTitle[MY_BUFSIZE]; // Contains fabricated | |
| // WindowTitle. | |
| char pszOldWindowTitle[MY_BUFSIZE]; // Contains original |