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
# for Emacs: -*- coding: utf-8 -*- | |
# | |
# User-defined key sequences for WinCompose | |
# by Sam Hocevar <[email protected]> | |
# | |
# Key sequences have the following form: | |
# | |
# <Multi_key> <key>… : "resulting text" | |
# |
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
defmodule Planet do | |
defstruct [:x, :y] | |
def gen_planet(x, y) do | |
xr = rem x, 7 | |
yr = rem y, 11 | |
if x > 4 and y > 8 and xr > 3 and xr < 6 and rem(yr, xr) === 1 do | |
%Planet{x: x, y: y} | |
else |
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
package tk.zorgatone.simpleoctree; | |
public interface Bounds { | |
Point getTopRight(); | |
Point getBottomLeft(); | |
} |
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
70 | |
7 | |
15 | |
67 | |
3 |
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
react-native-clean() { | |
if [ ! -f "react-native.config.js" ] && [ ! -f "app.json" ]; then | |
echo >&2 "Probably not a react-native project root folder!" | |
return 1 | |
else | |
echo "Detected react-native project root folder..." | |
fi | |
if [ -x "command -v watchman" ]; then | |
watchman watch-del-all |
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
def fizzbuzz(n) | |
1.upto(n) do |i| | |
div_by_5 = i % 5 == 0 | |
div_by_3 = i % 3 == 0 | |
if div_by_3 && div_by_5 | |
puts "#{i} Fizzbuzz" | |
elsif div_by_3 | |
puts "#{i} Fizz" | |
elsif div_by_5 | |
puts "#{i} Buzz" |
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
def get_title | |
print 'Enter movie title: ' | |
title = gets.chomp | |
if title.length < 1 | |
print 'Invalid title!' | |
return nil | |
else | |
return title.to_sym | |
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
eyJ3YXJyaW9yTmFtZSI6IlpvcmdhdG9uZSIsInRvd2VyTmFtZSI6ImJlZ2lubmVyIiwiZGlyZWN0b3J5UGF0aCI6Ii4iLCJsZXZlbE51bWJlciI6NSwic2NvcmUiOjE3NiwiY2x1ZSI6ZmFsc2UsImVwaWMiOmZhbHNlLCJlcGljU2NvcmUiOjAsImF2ZXJhZ2VHcmFkZSI6bnVsbCwiY3VycmVudEVwaWNTY29yZSI6MCwiY3VycmVudEVwaWNHcmFkZXMiOnt9fQ== |
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 <stdarg.h> | |
#include "util.h" | |
void vsfdie(FILE * stream, int code, const char *format, va_list arg) { | |
vfprintf(stream, format, arg); | |
va_end(arg); | |
exit(code); | |
} |
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
// EcmaScript 2015 | |
export default class PasswordGenerator { | |
constructor( | |
charset = "" | |
) { | |
this.charset = charset.toString().split("").sort().reduce((a, b) => { | |
if (a.charAt(a.length - 1) === b) { | |
return a; | |
} |
NewerOlder