Skip to content

Instantly share code, notes, and snippets.

@Sija
Sija / NSArray-Blocks.h
Created November 15, 2009 05:22
Making NSArray more ruby-ish
//
// NSArray-Blocks.h
// Handy codebits
//
// If you want to keep block definitions terse, simple and dynamic, have no
// problems with the incompatible block pointer types and you don't mind
// compiler warnings about sending a message without matching signature,
// DO NOT IMPORT THIS FILE, seriously.
//
// Created by Sijawusz Pur Rahnama on 15/11/09.
@xatest
xatest / coc_1.md
Last active December 10, 2015 22:39
Clash of Clans攻略(一):关键数值的意义~

#Clash of Clans攻略(一):关键数值的意义

##引言 前段时间对Clash of Clans做了一些游戏策划上的分析,我决定逐篇形成文字公开出来,给新手玩家做个指引,少走点弯路。我的本职工作与游戏策划无关,写此文时我的级别是30级,所以水平有限,多多指教。我不想写过于基础的攻略——有哪些资源,哪些建筑,哪些兵种——这种教程网上一搜一大把。

##关键数值 在游戏主界面上显示的5个数值,无疑是最重要的,分别是等级、奖杯、金币、水、宝石。下面说每个数值代表了什么样的宏观意义。

1. 等级(经验值)

等级代表了整体的建筑水平。经验值有4种输入(增加)途径,按增加的效率排序,1是建造/升级建筑,2是领取成就,3是给同部落盟友送兵,4是去掉地图上的石头/植物(一般叫除草)。其中第1种的增加效率远高于后3种,可以说经验值主要就是通过建造建筑贡献的,反过来经验值也就代表了整体的建筑水平。

#!/bin/bash
# This script automatically sets the version and short version string of
# an Xcode project from the Git repository containing the project.
#
# To use this script in Xcode, add the script's path to a "Run Script" build
# phase for your application target.
set -o errexit
set -o nounset
@yvasiyarov
yvasiyarov / gist:9911956
Created April 1, 2014 11:09
rows.Scan() optimal usage
//Prepare buffers for reading: one time before read first chunk
treader.rawBuffer = make([]sql.RawBytes, len(treader.columns))
// rows.Scan wants '[]interface{}' as an argument, so we must copy the
// references into such a slice
// See http://code.google.com/p/go-wiki/wiki/InterfaceSlice for details
treader.scanCallArgs = make([]interface{}, len(treader.rawBuffer))
for i := range treader.rawBuffer {
treader.scanCallArgs[i] = &treader.rawBuffer[i]
}
@wbotelhos
wbotelhos / clear-sidekiq-jobs.sh
Last active October 23, 2024 14:10
Clear Sidekiq Jobs
require 'sidekiq/api'
# 1. Clear retry set
Sidekiq::RetrySet.new.clear
# 2. Clear scheduled jobs
Sidekiq::ScheduledSet.new.clear
@chriswayg
chriswayg / create-cloud-template.sh
Last active May 1, 2024 20:47
This script will download a cloud image of many Linux distros and create a Proxmox 6 KVM template from it.
#!/bin/bash
set -o errexit
clear
printf "\n*** This script will download a cloud image and create a Proxmox VM template from it. ***\n\n"
### HOW TO USE
### Pre-req:
### - run on a Proxmox 6 server
### - a dhcp server should be active on vmbr1
@irazasyed
irazasyed / outbound-email-with-cloudflare.md
Last active November 18, 2024 04:22
Using Gmail SMTP with Cloudflare Email Routing: A Step-by-Step Guide

Using Gmail SMTP with Cloudflare Email Routing: Step-by-Step Guide

Learn how to send emails through Gmail SMTP with Cloudflare Email Routing in this comprehensive guide.

Step 1: Enable 2-Factor Authentication

To proceed with this method, ensure that you have enabled two-factor authentication for your Google account. If you haven't done so already, you can follow the link to set it up → Enable 2FA in your Google account.

Step 2: Create an App Password for Mail