Skip to content

Instantly share code, notes, and snippets.

library TriggeredAura
struct TriggeredAura
private static thistype array stack
private static integer count = 0
private static timer t = CreateTimer()
private static thistype active
private integer index
@muZk
muZk / $socket.js
Last active August 29, 2015 16:53
app.service("$socket", ['$timeout',function($timeout) {
var host = window.location.hostname;
var protocol = window.location.protocol;
var socket = io.connect(protocol + '//' + host);
this.on = function(event, callback) {
socket.on(event, function(data){
$timeout(function(){
callback.call(socket, data);
{
"npc_dota_hero_antimage": {
"abilities": {
"1": {
"cooldown": "21.0 18.0 15.0 12.0",
"damage": null,
"damage_type": "",
"description": null,
"mana_cost": "60 60 60 60",
"name": null,
@muZk
muZk / addon_englisj.json
Created November 29, 2015 20:30
Example JSON dump
{
"Heroes": {
"npc_dota_hero_antimage": {
"abilities": {
"1": {
"affects": null,
"behavior": "Point Target",
"cooldown": "21.0 18.0 15.0 12.0",
"damage": null,
"damage_type": null,
@muZk
muZk / vertical-align.css
Created July 14, 2016 16:51
CSS Vertical align
.vertical-aligned{
height: 100px;
display: table;
}
.vertical-content{
display: table-cell;
vertical-align: middle;
}
@muZk
muZk / mysql_create.rake
Created October 28, 2016 02:55
Rails rake task for creating a mysql user and password
namespace :db do
task 'mysql:create' do
puts '== Database Configuration =='
app_name = Rails.application.class.parent_name.underscore
database_name = ENV['database'] || "#{app_name}_db_#{Rails.env}"
database_user_name = ENV['database_user'] || "#{app_name}_user_#{Rails.env}"
database_user_password = ENV['database_password'] || ''
# my_payment_factory
FactoryGirl.define do
factory :my_payment do
after(:build) do |my_payment, evaluator|
my_payment.shopping_cart = FactoryGirl.create(:shopping_cart)
end
end
@muZk
muZk / README.md
Created May 26, 2017 19:20
Paperclip: how to move existing attachments to a new path
const mapStateToProps = (state) => {
return {
isAdding: state.isAdding,
}
};
const mapDispatchToProps = (dispatch) => {
return {
toggleAdding: () => {
dispatch({ type:'TOGGLE_IS_ADDING' })