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
# frozen_string_literal: true | |
# config/initializers/colorized_logger.rb | |
# This initializer adds color to the Rails logger output. It's a nice way to | |
# visually distinguish log levels. | |
module ColorizedLogger | |
COLOR_CODES = { | |
debug: "\e[36m", # Cyan | |
info: "\e[32m", # Green | |
warn: "\e[33m", # Yellow |
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
/* Plain CSS */ | |
/* Hide scrollbar for Chrome, Safari and Opera */ | |
.no-scrollbar::-webkit-scrollbar { | |
display: none; | |
} | |
/* Hide scrollbar for IE, Edge and Firefox */ | |
.no-scrollbar { | |
-ms-overflow-style: none; /* IE and Edge */ |
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
name: Deploy | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
Deploy: | |
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} |
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
// Correct way | |
package main | |
import ( | |
"errors" | |
"fmt" | |
) | |
var errDoopsy = errors.New("doopsy") |
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
# frozen_string_literal: true | |
class ApplicationService | |
def self.call(...) | |
new(...).call | |
end | |
def initialize(...) | |
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
fn main() { | |
let mut notifier = Notifier::new(); | |
notifier.add_filter(|n| n.incr_count(1)); | |
notifier.add_filter(|n| n.incr_count(1)); | |
let mut notice = Notice::new(); | |
println!("Before: {:#?}", notice); | |
notifier.notify(&mut notice); | |
println!("After: {:#?}", notice); |
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 ( | |
"database/sql" | |
"encoding/json" | |
"flag" | |
"fmt" | |
"io/ioutil" | |
"log" | |
"net/http" |
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
# $Id$ | |
# Maintainer: Sven-Hendrik Haase <sh@lutzhaase.com> | |
# Contributor: Matthew Bowra-Dean <matthew@ijw.co.nz> | |
pkgname=openra | |
pkgver=20150424 | |
pkgrel=1 | |
pkgdesc="An open-source implementation of the Red Alert engine using .NET/mono and OpenGL" | |
arch=('any') | |
url="http://openra.net" | |
license=('GPL3') |
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
x = {} | |
> Object {} | |
x[{}] = 1 | |
> 1 | |
x[{a: 999}] = 2 | |
> 2 | |
x[{}] | |
> 2 | |
x[{a: 999}] | |
> 2 |
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
-module(my_tuple_to_list). | |
-compile(export_all). | |
my_tuple_to_list(T) -> | |
my_tuple_to_list_acc(T, [], tuple_size(T)). | |
my_tuple_to_list_acc(_T, L, 0) -> L; | |
my_tuple_to_list_acc(T, L, N) -> | |
my_tuple_to_list_acc(T, [element(N, T)|L], N - 1). |
NewerOlder