Skip to content

Instantly share code, notes, and snippets.

@crackcomm
crackcomm / gist:1285748
Created October 13, 2011 22:36 — forked from mspanc/gist:1235911
Devise 1.4.6 polish translation
# Additional translations at http://github.com/plataformatec/devise/wiki/I18n
# Devise v1.4.6 polish translation by saepia based on @rogal111's translation
pl:
errors:
messages:
expired: "stracił ważność, wyślij zapytanie o nowy"
not_found: "nie znaleziono"
already_confirmed: "już został aktywowany, możesz się zalogować"
not_locked: "nie był zablokowany"
@crackcomm
crackcomm / rails_admin_action_creator
Created October 21, 2012 22:35 — forked from bbenezech/rails_admin_action_creator
Create a RailsAdmin custom action
say "Create stub for '#{action_name = name.sub('rails_admin_', '')}' in gem '#{name}'. This may take a while"
run "rm -rf script/ config/ lib/tasks/"
run "rm -rf app/assets app/controllers app/helpers app/mailers app/models"
run "mkdir -p app/views/rails_admin/main"
inside "app/views/rails_admin/main" do
create_file "#{action_name}.html.haml", <<-END
%h2 Custom action loaded and active
%pre @abstract_model.inspect
%pre @object.inspect
END
@crackcomm
crackcomm / client.py
Last active December 18, 2015 21:29 — forked from stevvooe/client.py
import json
import socket
s = socket.create_connection(("127.0.0.1", 5090))
s.sendall(json.dumps(({"id": 1, "method": "Hello.Hello", "params": ["hello"]})))
print s.recv(4096)
@crackcomm
crackcomm / 0_reuse_code.js
Created April 22, 2016 21:31
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
#
# Original source:
# https://gist.github.com/sofyanhadia/37787e5ed098c97919b8c593f0ec44d8
#
# Make sure you grab the latest version
curl -OL https://github.com/google/protobuf/releases/download/v3.2.0/protoc-3.2.0-linux-x86_64.zip
# Unzip
unzip protoc-3.2.0-linux-x86_64.zip -d protoc3
@crackcomm
crackcomm / output_shape_for.py
Created April 29, 2019 22:28 — forked from Erotemic/output_shape_for.py
Output shape information for pytorch
import math
import torch
import torch.nn as nn
import torchvision
REGISTERED_OUTPUT_SHAPE_TYPES = []
def compute_type(type):
def _wrap(func):
@crackcomm
crackcomm / liquidation_calculator.py
Created September 18, 2023 14:39 — forked from mattj161/liquidation_calculator.py
Binance liquidation calculator (based
# BTC-USDT
x125_lookup_table = [
( 50_000, 0.004, 0),
( 250_000, 0.005, 50),
( 1_000_000, 0.01, 1_300),
( 10_000_000, 0.02, 16_300),
( 20_000_000, 0.05, 266_300),
( 50_000_000, 0.1, 1_266_300),
( 100_000_000, 0.125, 2_516_300),