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
def rotate?(a, b) | |
a.length == b.length && (a * 2).include?(b) | |
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
class Array | |
def is_cycle? | |
!!(self.inspect =~ /[^"]\[\.\.\.\][^"]/) | |
end | |
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
(!![]+Date())[30]+(!![]+Date())[30]+(+(101))["toString"](21)[1]+([![]]+[][[]])[10]+(+[![]]+[+(+!+[]+(!+[]+[])[!+[]+!+[]+!+[]]+[+!+[]]+[+[]]+[+[]]+[+[]])])[10]+(!![]+[]["filter"])[10]+(+(20))["toString"](21)+(!![]+[]["filter"])[10] |
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
def 🍣 (🔪 , 🐠 ) | |
((🐠 =~ / 🐠 | 🐟 | 🐡 /) and (🔪 =~ /🔪|🍴/))? | |
__method__: | |
'💩' | |
end | |
puts 🍣 '🔪 ', ' 🐡 ' #=> 🍣 |
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
services = {} | |
def body_parser(body) | |
params = {} | |
body.split('&').each do |x| | |
tokens = x.split('=', 2) | |
if tokens && tokens.size == 2 | |
params[tokens[0]] = HTTP::URL::decode(tokens[1]) | |
end | |
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
SELECT | |
e.id AS event_id, | |
e.name, | |
s1.id AS schedule_id, | |
date_format(s1.due_date, '%Y/%m/%d') AS due_date | |
FROM events e | |
LEFT JOIN schedules s1 | |
ON e.id = s1.event_id | |
WHERE s1.id IS NULL | |
OR s1.id = ( |
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" | |
"bytes" | |
"fmt" | |
"log" | |
"os" | |
"os/exec" |
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
class FizzBuzz(object): | |
def __init__(self): | |
self.Buzz = lambda n: n % 5 == 0 | |
self.Fizz = lambda n: n % 3 == 0 | |
def call(self, n): | |
return ''.join([k for k, v in self.__dict__.items() if v(n)]) or n | |
print [FizzBuzz().call(n) for n in range(1, 101)] |
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
class FizzBuzz(object): | |
def __init__(self): | |
self.Buzz = lambda n: n % 5 == 0 | |
self.Fizz = lambda n: n % 3 == 0 | |
def call(self, n): | |
return ''.join([k for k, v in self.__dict__.items() if v(n)]) or n | |
def generator(self, n, m): | |
_x = 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
require 'serverspec' | |
require 'pathname' | |
require 'net/ssh' | |
require 'highline/import' | |
include Serverspec::Helper::Ssh | |
include Serverspec::Helper::DetectOS | |
RSpec.configure do |c| | |
if ENV['ASK_SUDO_PASSWORD'] |
OlderNewer